
[已解決]批處理命令被跳過沒有執行
nclick="copycode($('code0'));">復制代碼
- @echo off
- sc stop LazyStopService
- ping -n 12 127.0.0.1 >nul 2>nul
- for /f %%a in ('wmic SERVICE where name^=LazyStopService get ProcessId^|findstr [0-9]') do (
- tasklist /fi pid eq %%a |find %%a 2>nul
- if %errorlevel% == 0 (
- echo one error
- sc stop LazyStopService
- ping -n 12 127.0.0.1 >nul 2>nul
- tasklist /fi pid eq %%a |find %%a 2>nul
- if %errorlevel% == 0 (
- echo two error
- sc stop LazyStopService
- ping -n 10 127.0.0.1 >nul 2>nul
- tasklist /fi pid eq %%a |find %%a 2>nul
- if %errorlevel% == 0 (
- echo three error
- taskkill /F /PID %%a
- )
- )
- )
- )
- echo haha

