@shift 1
@echo off
CLS
color 0a
echo.
echo               VMware Workstation-6.0.3-80004 绿色精简版
echo.
echo.
echo                                 即将进行安装，是否要继续......
echo.     
echo ---------------------------------------------------------------------------
echo.
SET /P ST=   请输入 Y (继续安装)或 N (退出安装)：
echo.
if /I "%ST%"=="Y" goto ST
if /I "%ST%"=="N" goto EX
goto EX

:ST

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

:addreg
echo 正在添加注册表项目...
set regadd=reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup
%regadd%" /v "SourcePath" /d "%systemroot%\inf" /f
set regadd=reg add "HKEY_LOCAL_MACHINE\SOFTWARE\VMware, Inc.
%regadd%" /v Core /d "VMware Workstation" /f
set regadd=%regadd%\VMware Workstation
%regadd%" /v "InstallPath" /d "%cd%" /f
set regadd=%regadd%\License.ws.6.0.200907
%regadd%" /v "StartFields" /d "Cpt, ProductID, LicenseVersion, LicenseType, Epoch" /f
%regadd%" /v "Cpt" /d "COPYRIGHT (c) VMware, Inc. 1999-2007" /f
%regadd%" /v "ProductID" /d "VMware Workstation for Win32" /f
%regadd%" /v "LicenseVersion" /d "6.0" /f
%regadd%" /v "LicenseType" /d "User" /f
%regadd%" /v "Epoch" /d "2009-7-1" /f
%regadd%" /v "Hash" /d "6b3d34d9-b34f898e-2600b82e-9f65a272-44f2afe8" /f
%regadd%" /v "Serial" /d "FK4W8-8UD0L-C80FG-4MXZ6" /f
%regadd%" /v "Name" /d "kenneth0520" /f
%regadd%" /v "CompanyName" /d "vmware.cn" /f
@reg  add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom" /v "Autorun" /d "0" /f

:adduser
echo 开始创建 __vmware_user__ 账户 ...
net user __vmware_user__ /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 装载虚拟机需要基本服务 ...
sc create vmx86 type= kernel start= auto binpath= "%cd%\drivers\vmx86.sys" displayname= "VMware Virtualization Driver"
net start vmx86
sc create VMnetuserif type= kernel start= auto binpath= "%cd%\drivers\vmnetuserif.sys" displayname= "VMware Network Application Interface"
net start VMnetuserif
CALL server.cmd
