cls
@echo off
CLS
color 0a

:delete VM Network
echo 正在删除虚拟网卡，请稍后...
vnetlib.exe -- uninstall adapter >nul 2>nul
echo.

:delservice
echo 正在删除服务，请稍后...
net stop VMUSBArbService >nul 2>nul
sc delete VMUSBArbService >nul 2>nul
vnetlib.exe -- stop usb >nul 2>nul
vnetlib.exe -- uninstall usb >nul 2>nul
vnetlib.exe -- stop hcmon
vnetlib.exe -- uninstall hcmon
vnetlib.exe -- stop authd >nul 2>nul
vnetlib.exe -- uninstall authd >nul 2>nul
vnetlib.exe -- stop host >nul 2>nul
vnetlib.exe -- uninstall host >nul 2>nul
vnetlib.exe -- stop bridge >nul 2>nul
vnetlib.exe -- uninstall bridge >nul 2>nul
vnetlib.exe -- stop vmkbd >nul 2>nul
vnetlib.exe -- uninstall vmkbd >nul 2>nul
vnetlib.exe -- stop userif >nul 2>nul
vnetlib.exe -- uninstall userif >nul 2>nul
vnetlib.exe -- stop vmx86 >nul 2>nul
vnetlib.exe -- uninstall vmx86 >nul 2>nul
vnetlib.exe -- stop vmci >nul 2>nul
vnetlib.exe -- uninstall vmci >nul 2>nul
msiexec.exe -x vmwarevmcisockets64.msi -qn -norestart
echo.

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

echo 删除配置文件...
rd /s /q "%AllUsersProfile%\Application Data\VMware" >nul 2>nul
rd /s /q "%AppData%\VMware" >nul 2>nul
echo.

:delreg
echo 删除注册表....
reg delete "HKLM\SOFTWARE\Wow6432Node\VMware, Inc." /f >nul 2>nul
reg delete "HKLM\SOFTWARE\VMware, Inc.\VMware Workstation" /f >nul 2>nul
reg delete "HKCR\Installer\Features\7A26F0EA2A1AF704F9C48439B99DDAD8" /f  >nul 2>nul
reg delete "HKCR\Installer\Features\7A79579133DA8984D9E8376086814B46" /f  >nul 2>nul
reg delete "HKCR\Installer\Features\A116201D664610145AD115603930CA56" /f  >nul 2>nul
reg delete "HKCR\Installer\Features\BC78C1BA70810FC44B2CEC1EC481DC4B" /f  >nul 2>nul
reg delete "HKCR\Installer\Features\C3839DFF5D1079849A4534FA95A9DE03" /f  >nul 2>nul
reg delete "HKCR\Installer\Features\DBBFB30076C6E9142AD4D0ACCFA32594" /f  >nul 2>nul
reg delete "HKCR\Installer\Products\7A26F0EA2A1AF704F9C48439B99DDAD8" /f  >nul 2>nul
reg delete "HKCR\Installer\Products\7A79579133DA8984D9E8376086814B46" /f  >nul 2>nul
reg delete "HKCR\Installer\Products\A116201D664610145AD115603930CA56" /f  >nul 2>nul
reg delete "HKCR\Installer\Products\BC78C1BA70810FC44B2CEC1EC481DC4B" /f  >nul 2>nul
reg delete "HKCR\Installer\Products\C3839DFF5D1079849A4534FA95A9DE03" /f  >nul 2>nul
reg delete "HKCR\Installer\Products\DBBFB30076C6E9142AD4D0ACCFA32594" /f  >nul 2>nul
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\7A26F0EA2A1AF704F9C48439B99DDAD8" /f >nul 2>nul
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\7A79579133DA8984D9E8376086814B46" /f >nul 2>nul
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\A116201D664610145AD115603930CA56" /f >nul 2>nul
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\BC78C1BA70810FC44B2CEC1EC481DC4B" /f >nul 2>nul
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\C3839DFF5D1079849A4534FA95A9DE03" /f >nul 2>nul
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\DBBFB30076C6E9142AD4D0ACCFA32594" /f >nul 2>nul
echo.

:deluser
echo 删除用户__vmware_user__...
net user __vmware_user__ /delete
net localgroup __vmware__ /delete

echo.
echo.
pause>nul|echo 卸载完成，请重新启动计算机......
exit
