0
votes

i had used a batch cmd (xxx.bat) to execute a psexec function as follows:

C:\psexec.exe \192.168.xxx.xx -u server1\admin -p password C:\xxx.bat

the above batch file can run successfully to remote execute file.

but i found that there are many cmd.exe and psexec.exe process in task manager, that the batch file cannot kill process after execute.

do you know how to kill cmd.exe and psexec.exe process after execute ?

thanks

Joe

1

1 Answers

1
votes

I'm sure there's a better way, but personally, I do this using pskill, e.g.:

pskill.exe \\\\192.168.x.x -u user -p pass -t <imagename>

You can find the name of the executable that you want to kill using the pslist command, also in the pstools toolset.