低碳环保-VMware服务批处理

一月 28, 2010, Posted by cike at 10:30 上午

跑着WIN7,开着XAMPP、PS、FF、IE、chrome,不能再让WM占位了,查看了下服务列表,VMAuthdService、VMnetDHCP、VMware NAT Service三服务是必须的其他Agent、USB可以忽略了,过低碳生活,只要启动VMware时才启动相关服务,批处理是必备良药

net star VMware NAT Service,报 The syntax of this command is:……

带着JS、PHP的思维改成了net star ‘VMware NAT Service’,习惯性用了单引号,错误依旧,百度之,换双引号,通过,这个细节需要注意,双引号比单引号要安全。

以下是最终的批处理代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@echo off
ECHO +-------------------------+
ECHO |  VMware Control Bat    |
ECHO |  Author:cike.org       |
ECHO +-------------------------+
color 0a
 
GOTO MENU
:MENU
ECHO.
ECHO. =-=-=-=-=菜单=-=-=-=-=
ECHO.
ECHO. 1 启动虚拟机相关服务
ECHO.
ECHO. 2 关闭虚拟机相关服务
ECHO.
ECHO. 3 退 出
ECHO.
ECHO.
ECHO.
echo. 请选择:
set /p ID=
if "%id%"=="1" goto cmd1
 
if "%id%"=="2" goto cmd2
 
if "%id%"=="3" exit
PAUSE
 
:cmd1
net start VMAuthdService
net start VMnetDHCP
net start "VMware NAT Service"
start D:\VMware\vmware.exe
goto MENU
 
:cmd2
net stop VMAuthdService
net stop VMnetDHCP
net stop "VMware NAT Service"
GOTO MENU

No comment yet.

Leave a Reply








Scroll to the top