cls
@echo off
CLS
color 0a

:regdll
echo 注册所需的DLL文件....
regsvr32 /s "%cd%/vmappcfg.dll"
regsvr32 /s "%cd%/vmappsdk.dll"
regsvr32 /s "%cd%/vmdbCOM.dll"
echo.

:addreg
echo 添加注册表项目...
rundll32 setupapi.dll,InstallHinfSection DefaultInstall 128 .\install.inf
echo.

:adduser
echo 创建 __vmware_user__ 账户 ...
net user __vmware_user__ vm-ware123 /add /comment:"VMware User" /fullname:"__vmware_user__"
net localgroup __vmware__ /add /comment:"VMware User Group"  >nul
net localgroup users __vmware_user__ /del >nul
net localgroup __vmware__ __vmware_user__ /add >nul

:Start VM basic service
echo 安装VM基本服务 ...
vnetlib.exe -- install vmx86
vnetlib.exe -- start vmx86
msiexec.exe -i vmwarevmcisockets64.msi -qn -norestart
echo.

SET /P ST=   请输入 Y (安装服务)或 N (完成安装)
echo.
if /I "%ST%"=="Y" goto ST
if /I "%ST%"=="N" goto EX
goto EX

:ST
CALL Services.cmd
:EX
exit