
CODE: [Copy to clipboard]@echo off
for /f "tokens=1-4 delims= " %%a in ('sc query mysql^|findstr "STATE"') do (
if "%%d" neq "RUNNING" (
sc config mysql start= demand
sc start mysql
) else (
sc stop mysql
)
)
CODE: [Copy to clipboard]sc query mysql|findstr /i "stopped"&&sc config "mysql" start= demand&&sc start mysql||sc stop mysql
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |