前面介绍的方法中的一个缺点是
如果你的机器上已经关闭了某些服务时
使用这个bat会产生大量的出错信息,下面
给出closesrv.bat的改进版本,这个版本中将不会再出现那些没有用处的出错信息了。
closesrv.bat
@echo off
@echo 开始关闭服务···
net stop appmgmt /y 2>nul
net stop iisadmin /y 2>nul
net stop kdc /y 2>nul
net stop LicenseService /y 2>nul
net stop lmhosts /y 2>nul
net stop msg /y 2>nul
net stop mnmsrvc /y 2>nul
net stop msdtc /y 2>nul
net stop msiserver /y 2>nul
net stop netdde /y 2>nul
net stop netddedsdm /y 2>nul
net stop NetLogon /y 2>nul
net stop nntpsvc /y 2>nul
net stop ipsec /y 2>nul
net stop policyagent /y 2>nul
net stop remoteaccess /y 2>nul
net stop RemoteRegistry /y 2>nul
net stop rpclocator /y 2>nul
net stop rsvp /y 2>nul
net stop seclogon /y 2>nul
net stop smtpsvc /y 2>nul
net stop Spooler /y 2>nul
net stop termservice /y 2>nul
中国网管论坛bbs.bitsCN.com net stop tlntsvr /y 2>nul
net stop trksvr /y 2>nul
net stop w32time /y 2>nul
net stop w3svc /y 2>nul
net stop msftpsvc /y 2>nul
@echo 关闭服务结束···