|
安装VM后发现默认服务是启动的,但并不是每次动用到VM,为了优化系统,可以考虑按需启动服务,但每次手工启动好几个相关的服务的确比较麻烦。可以考虑采用批处理的方式来解决启动、停止的问题:
@ echo off
title vmware服务开启、关闭程序
set in=set /p in=1.开启vm服务,2.关闭vm服务。请输入:
if "%in%"=="1" goto start
if "%in%"=="2" goto stop
exit
:start
net start ufad-ws60
net start VMAuthdService
net start VMnetDHCP
net start "VMware NAT Service"
net start VMUSBArbServicepause
exit
:stop
net stop ufad-ws60
net stop VMAuthdService
net stop VMnetDHCP
net stop "VMware NAT Service"
net stop VMUSBArbService
pause
exit
或者如下:
echo off
title Switch %date% %time%
:A
color A
cls
echo ++++++++++++++++++++++++++++++++++++++++++++++++
echo = WELCOME TO VMware SWITCH =
echo. = =
echo = 启动= 1 关闭= 2 设置手动= 3 退出= 4 =
echo. = =
echo. = =
echo ++++++++++++++++++++++++++++++++++++++++++++++++
echo.
echo.
set session=""
set /p session= Select[1/2/3/4]:
if /i "%session%"=="1" (goto:1)
if /i "%session%"=="2" (goto:2)
if /i "%session%"=="3" (goto:3)
if /i "%session%"=="4" (goto:4)
:1
echo "正在启动VMware相关开机服务..."
net start VMAuthdService
net start VMnetDHCP
net start "VMware NAT Service"
net start VMUSBArbService
echo 服务启动完毕!
ping 127.0.0.1 /n 2 >nul
goto:A
:2
echo "正在关闭VMware相关开机服务..."
net stop VMAuthdService
net stop VMnetDHCP
net stop "VMware NAT Service"
net stop VMUSBArbService
echo 服务已关闭!
ping 127.0.0.1 /n 2 >nul
goto:A
:3
echo 切换VMware开机启动服务为手动中,请稍候...
sc config VMAuthdService start= demand
sc config VMnetDHCP start= demand
sc config "VMware NAT Service" start= demand
sc config VMUSBArbService start= demand
echo 成功切换为手动模式!
ping 127.0.0.1 /n 2 >nul
goto:A
:4
cls
echo 谢谢使用...
ping 127.0.0.1 /n 2 >nul
exit
另外,如果安装VM之后,开机时按一下用户名才能登录桌面的解决方法:
1运行框中输入netplwiz
2取消 "要使用本机,用户必须输入用户名和密码" 前面的勾 |
|
|
|
|
|
|