意大利木纹石价格:关于服务的批处理

来源:百度文库 编辑:神马品牌网 时间:2024/05/01 23:42:37
比如一个服务叫abs
那么开启它用net start "abs"
关闭用"net stop "abs"
现在我想实现:
IF abs开启 then 关闭它
IF abs关闭 then 开启它
高手帮我写个XP下的批处理命令

@echo off
net start | find "abs"
if errorlevel 1 goto startsvc
if errorlevel 0 goto closesvc

:startsvc
net start "abs"
goto end

:closesvc
net stop "abs"
goto end

:end