`

VMware Workstation 无法彻底卸载 提示"The MSI failed." 解决方法

阅读更多
卸载vm8时出现异常失败了,安装过程中提示The MSI failed,Warning 1946.Property 'System.AppUserModel.Id'等,各种异常信息。

从网上找很多方法,比如去注册表删除啊,卸载vmware服务啊。我觉得都不是很简单。

突发奇想,找了一个wmware9绿色版,用它的“卸载wmwar”批处理文件很管用,卸载成功后再重新启动一下计算机,就可以顺利从系统“添加/删除程序”里面彻彻底底卸载掉了。哈哈

现分享一下这个批处理文件,文件名“卸载VMware.cmd”,下载源文件,请下载页面下的附件。
cls
@echo off
CLS
color 0a
Title 卸载 VMware
set vmbit=
if "%PROCESSOR_ARCHITECTURE%" neq "x86" set vmbit=64

echo 你确定要卸载 VMware 吗?
echo 按任意键继续卸载 VMware !!!&pause>nul

echo 正在删除服务和设备,可能需要几分钟,请稍后...
echo 如果三分钟后还没动静,请在卸载批处理上敲一下回车键后继续等待...

vnetlib%vmbit%.exe -- stop authd >nul 2>nul
vnetlib%vmbit%.exe -- uninstall authd >nul 2>nul
net stop VMAuthdService >nul 2>nul
sc delete VMAuthdService >nul 2>nul
net stop VMwareHostd >nul 2>nul
sc delete VMwareHostd >nul 2>nul

vnetlib%vmbit%.exe -- stop dhcp >nul 2>nul
vnetlib%vmbit%.exe -- uninstall dhcp >nul 2>nul
vnetlib%vmbit%.exe -- stop nat >nul 2>nul
vnetlib%vmbit%.exe -- uninstall nat >nul 2>nul
vnetlib%vmbit%.exe -- stop bridge >nul 2>nul
vnetlib%vmbit%.exe -- uninstall bridge >nul 2>nul
vnetlib%vmbit%.exe -- stop userif >nul 2>nul
vnetlib%vmbit%.exe -- uninstall userif >nul 2>nul
vnetlib%vmbit%.exe -- stop adapter >nul 2>nul
vnetlib%vmbit%.exe -- uninstall adapter >nul 2>nul
rundll32 vnetlib%vmbit%.dll,VNL_RemoveAllNetworkDevices

net stop VMUSBArbService >nul 2>nul
sc delete VMUSBArbService >nul 2>nul
vnetlib%vmbit%.exe -- stop usb
vnetlib%vmbit%.exe -- uninstall usb
vnetlib%vmbit%.exe -- stop hcmon >nul 2>nul
vnetlib%vmbit%.exe -- uninstall hcmon >nul 2>nul

net stop vstor2-mntapi10-shared >nul 2>nul
sc delete vstor2-mntapi10-shared >nul 2>nul

vnetlib%vmbit%.exe -- stop vmkbd >nul 2>nul
vnetlib%vmbit%.exe -- uninstall vmkbd >nul 2>nul
net stop vmkbd >nul 2>nul
sc delete vmkbd >nul 2>nul

vnetlib%vmbit%.exe -- stop vmparport >nul 2>nul
vnetlib%vmbit%.exe -- uninstall vmparport >nul 2>nul

ver|find "5.">nul && (DrvInst.exe -uninstall "ROOT\VMWVMCIHOSTDEV" 0 >nul 2>nul)
ver|find "6.">nul && (devcon%vmbit%.exe remove "ROOT\VMWVMCIHOSTDEV" >nul 2>nul)

vnetlib%vmbit%.exe -- stop vsock >nul 2>nul
net stop vsock >nul 2>nul
sc delete vsock >nul 2>nul

vnetlib%vmbit%.exe -- stop vmx86 >nul 2>nul
vnetlib%vmbit%.exe -- uninstall vmx86 >nul 2>nul

vnetlib%vmbit%.exe -- uninstall vmci
echo.

echo 取消DLL文件的注册...
regsvr32 /u /s "%cd%\vmappcfg.dll"
regsvr32 /u /s "%cd%\vmappsdk.dll"
regsvr32 /u /s "%cd%\vmdbCOM.dll"
echo.

echo 删除注册表....
reg delete "HKEY_CURRENT_USER\SOFTWARE\ThinPrint" /f >nul 2>nul
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\ThinPrint" /f >nul 2>nul
reg delete "HKEY_CURRENT_USER\SOFTWARE\VMware, Inc." /f >nul 2>nul
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc." /f >nul 2>nul
reg delete "HKEY_CURRENT_USER\Software\Wow6432Node\VMware, Inc." /f >nul 2>nul
reg delete "HKEY_LOCAL_MACHINE\Software\Wow6432Node\VMware, Inc." /f >nul 2>nul
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32" /f /v "VIDC.VMnc" >nul 2>nul
reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VMware" /f >nul 2>nul
echo.

echo 删除文件...
rmdir /s /q "%AllUsersProfile%\Application Data\VMware" >nul 2>nul
rmdir /s /q "%AppData%\VMware" >nul 2>nul
rmdir /s /q "%CommonProgramFiles%\VMware" >nul 2>nul
IF "%PROCESSOR_ARCHITECTURE%" neq "x86" rmdir /s /q "%CommonProgramFiles(x86)%\VMware" >nul 2>nul
del /f /q "%WinDir%\system32\vmnc.dll" >nul 2>nul
del /f /q "%WinDir%\SysWOW64\vmnc.dll" >nul 2>nul
del /f /q "%WinDir%\system32\vnetinst.dll" >nul 2>nul
del /f /q "%WinDir%\system32\vnetlib*.dll" >nul 2>nul
del /f /q "%windir%\system32\drivers\vstor2-mntapi10-shared.sys" >nul 2>nul
del /f /q "%WinDir%\SysWOW64\drivers\vstor2-mntapi10-shared.sys" >nul 2>nul
del /f /q "%AllUsersProfile%\桌面\VMware.lnk" >nul 2>nul
del /f /q "%AllUsersProfile%\Desktop\VMware.lnk" >nul 2>nul
del /f /q "%USERPROFILE%\桌面\VMware.lnk" >nul 2>nul
del /f /q "%USERPROFILE%\Desktop\VMware.lnk" >nul 2>nul
del /f /q "%WinDir%\system32\drivers\vmnet*.sys" >nul 2>nul
del /f /q "%WinDir%\system32\drivers\vmparport.sys" >nul 2>nul
del /f /q "%WinDir%\system32\drivers\VMkbd.sys" >nul 2>nul
del /f /q "%WinDir%\system32\drivers\vmx86.sys" >nul 2>nul
del /f /q "%WinDir%\system32\drivers\vmusb.sys" >nul 2>nul
del /f /q "%WinDir%\system32\drivers\vmci.sys" >nul 2>nul
del /f /q "%WinDir%\system32\vmnetdhcp.exe" >nul 2>nul
del /f /q "%WinDir%\system32\vmnat.exe" >nul 2>nul
del /f /q "%WinDir%\system32\vmnetbridge.dll" >nul 2>nul
del /f /q "%WinDir%\SysWOW64\vmnetdhcp.exe" >nul 2>nul
del /f /q "%WinDir%\SysWOW64\vmnat.exe" >nul 2>nul
echo.

echo 删除 __vmware_user__ 账户和用户组 ...
net localgroup users __vmware_user__ /del >nul 2>nul
net localgroup __vmware__ /del >nul 2>nul
net user __vmware_user__ /del >nul 2>nul
echo.

echo 恢复配置文件...
ver|find "6.">nul && (set profilepath=%AllUsersProfile%)
ver|find "5.">nul && (set profilepath=%AllUsersProfile%\Application Data)
start /wait str.exe preferences.ini 0 0 /R /asc:"%cd%" /asc:"VMwareDir" /A >nul 2>nul
start /wait str.exe environments.xml 0 0 /R /asc:"%cd%" /asc:"VMwareDir" /A >nul 2>nul

start /wait str.exe "%profilepath%\VMware\hostd\config.xml" 0 0 /R /asc:"%cd%" /asc:"VMwareDir" /A >nul 2>nul
start /wait str.exe "%profilepath%\VMware\hostd\datastores.xml" 0 0 /R /asc:"%cd%" /asc:"VMwareDir" /A >nul 2>nul
start /wait str.exe "%profilepath%\VMware\hostd\stats\hostAgentStats.xml" 0 0 /R /asc:"%profilepath%\VMware" /asc:"hostdDir" /A >nul 2>nul
start /wait str.exe "%profilepath%\VMware\hostd\config.xml" 0 0 /R /asc:"%profilepath%\VMware" /asc:"hostdDir" /A >nul 2>nul

net stop "VMware NAT Service" >nul 2>nul&&sc delete "VMware NAT Service" >nul 2>nul
net stop VMnetDHCP >nul 2>nul&&sc delete VMnetDHCP >nul 2>nul
net stop VMnetAdapter >nul 2>nul&&sc delete VMnetAdapter >nul 2>nul
net stop vmusb >nul 2>nul&&sc delete vmusb >nul 2>nul
net stop VMnetBridge >nul 2>nul&&sc delete VMnetBridge >nul 2>nul
net stop vmci >nul 2>nul&&sc delete vmci >nul 2>nul
echo.
sc delete "vstor2-mntapi10-shared" >nul 2>nul
sc delete "VMparport" >nul 2>nul
sc delete VMUSBArbService >nul 2>nul
sc delete VMnetDHCP >nul 2>nul
sc delete "VMware NAT Service" >nul 2>nul
sc delete VMAuthdService >nul 2>nul
sc delete VMnetuserif >nul 2>nul
sc delete VMnetAdapter >nul 2>nul
sc delete vmkbd >nul 2>nul
sc delete vmx86 >nul 2>nul
echo.
pause>nul|echo 卸载完成,最好重新启动一下计算机,因为有些驱动可能需要重启后才能删除......
exit
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics