发布网友 发布时间:2022-04-24 03:57
共2个回答
热心网友 时间:2023-05-27 01:45
批处理其实实现起来很简单,用的就是sc服务配置命令,以及net start/stop命令。具体是VMware虚拟机服务停止代码如下:
禁止VMware相关服务命令
@echo off
title 禁用并停止VM8.03相关服务
sc config "VMware NAT Service" start= DISABLED
sc config vmnetdhcp start= DISABLED
sc config vmauthdservice start= DISABLED
SC config VMUSBArbService start= DISABLED
SC config vmware-converter-worker start= DISABLED
SC config VMwareHostd start= DISABLED
SC config VMUSBArbService start= DISABLED
net stop VMUSBArbService
net stop vmware-converter-worker
net stop VMwareHostd
net stop "VMware NAT Service"
net stop vmnetdhcp
net stop vmauthdservice
echo 禁用并停止VM相关服务 OK
pause
注意:以ANSI格式编码存储,否则出现中文乱码,start=空格disabled,等号后面有个空格
启用VMware相关服务命令
@echo off
title 启用VM8.03相关服务
sc config "VMware NAT Service" start= AUTO
sc config vmnetdhcp start= AUTO
sc config vmauthdservice start= AUTO
SC config VMUSBArbService start= AUTO
SC config vmware-converter-worker start= AUTO
SC config VMwareHostd start= AUTO
SC config VMUSBArbService start= AUTO
net start VMUSBArbService
net start vmware-converter-worker
net start VMwareHostd
net start "VMware NAT Service"
net start vmnetdhcp
net start vmauthdservice
echo 启用VM相关服务 OK
pause
写在最后
以上的命令优化空间很多,例如将两个批处理合在一起,通过goto语句实现跳转。还可以增加进程检测,程序自动启动功能。
热心网友 时间:2023-05-27 01:45
VMware服务怎么启用和停止?-最系统 http://www.zuixitong.com/xitong/wenti/cz/408.html