A simple way to see tasks on remote pcs and then kill them the lazy way
TASK LIST
cmd.exe /K {actionpath}pslist.exe -s -r 3 \\{computer}
The options set it to open a dos window and refresh every 3 seconds so you can see whats up.
pslist is from PStools kit you can get from microsoft at www.sysinternals.com
TASK KILL
{actionpath}taskkill.bat {computer}
the batch file would read. It just asks for the ID of the process or the name. allows repeat.
the NAMEOFSERVERHERE needs to be your server incase you do not have pskill locally 🙂 i just put it on the lansweeper server share.
@echo off
if %1.==. GOTO END
:STARTOFKILL
ECHO.
@ECHO Preparing to kill Process on computer %1
REM Clearing variables
set killprocess=
set killagain=
set idkill=
ECHO.
set /p killprocess=Do you wish to kill a process (n/y) [enter=skip]?
if {%killprocess%}=={y} goto yeskill
if {%killprocess%}=={n} goto nokill
if %killprocess%.==. goto nokill
goto nokill
:yeskill
set /p idkill=Enter number only of ID to delete [process name or process id]?
\\NAMEOFSERVERHERE\lansweeper$\pskill.exe \\%1 %idkill%
set /p killagain=Do you wish to kill another process (n/y) [enter=skip]?
if {%killagain%}=={y} goto STARTOFKILL
if {%killagain%}=={n} goto noagainkill
:noagainkill
:nokill
ECHO.
ECHO Press any key to close this window...
pause>nul
GOTO END
:BLANK
:END