nail1987
17-08-2015, 21:00
вот батник который завершает зависшие процессы
нужно его дополнить чтоб он запускался в месте с системой
и что не было видно окно cmd
@echo off
:#
setlocal
for /f "tokens=1,2 delims=," %%i in ('
tasklist/fi "status eq not responding" /nh /fo csv^|^
findstr/v :
') do (
set/a n+=1
call set $process%%n%%=%%~j %%~i
)
for /f "tokens=2* delims== " %%i in ('2^>nul set $process') do (
set command=^
^>nul ping -n 6 localhost^&^
tasklist/fi "status eq not responding" /fi "pid eq %%i" /nh /fo csv^|^
^>nul findstr/v :^&^&^
^>nul 2^>^&1 taskkill/f /pid %%i /t^&^&^
echo The "%%j" process with PID %%i has been terminated.
call:##
)
>nul ping -n 6 localhost& endlocal& goto:#
:##
start ""/b cmd /c "%command%"& goto:eof
нужно его дополнить чтоб он запускался в месте с системой
и что не было видно окно cmd
@echo off
:#
setlocal
for /f "tokens=1,2 delims=," %%i in ('
tasklist/fi "status eq not responding" /nh /fo csv^|^
findstr/v :
') do (
set/a n+=1
call set $process%%n%%=%%~j %%~i
)
for /f "tokens=2* delims== " %%i in ('2^>nul set $process') do (
set command=^
^>nul ping -n 6 localhost^&^
tasklist/fi "status eq not responding" /fi "pid eq %%i" /nh /fo csv^|^
^>nul findstr/v :^&^&^
^>nul 2^>^&1 taskkill/f /pid %%i /t^&^&^
echo The "%%j" process with PID %%i has been terminated.
call:##
)
>nul ping -n 6 localhost& endlocal& goto:#
:##
start ""/b cmd /c "%command%"& goto:eof