Issue with running Sysinternals PSKill from a batch file
Posted: 21 Sep 2016 12:31
I'm having some real problems trying to run pskill.
What I'm trying to do is kill every process on the computer that comes from chrome.exe in a certain folder. I don't want to kill every chrome.exe process, because the one I am targeting is a portable copy.
Batch for testing this code: http://pastebin.com/14zrbyvq
Full batch: http://pastebin.com/cMH6BGEH (starting at line 672)
When I execute, it gives me the usage for pskill. The same exact command echoed shows fine and can be copied and pasted and will work fine.
When I turn echo on, I get some strange output, including some commands being truncated (ECHO being output as HO, for example).
If using the first batch file, set TKCHROME2 to any executable (such as c:\windows\notepad.exe) and open that executable.
Download PSTools from https://technet.microsoft.com/en-us/sys ... tools.aspx and put pskill.exe somewhere the batch can find it.
Tearing my hair out over this one, everything seems to be correct, but clearly something is being changed.
What I'm trying to do is kill every process on the computer that comes from chrome.exe in a certain folder. I don't want to kill every chrome.exe process, because the one I am targeting is a portable copy.
Batch for testing this code: http://pastebin.com/14zrbyvq
Full batch: http://pastebin.com/cMH6BGEH (starting at line 672)
When I execute, it gives me the usage for pskill. The same exact command echoed shows fine and can be copied and pasted and will work fine.
When I turn echo on, I get some strange output, including some commands being truncated (ECHO being output as HO, for example).
If using the first batch file, set TKCHROME2 to any executable (such as c:\windows\notepad.exe) and open that executable.
Download PSTools from https://technet.microsoft.com/en-us/sys ... tools.aspx and put pskill.exe somewhere the batch can find it.
Tearing my hair out over this one, everything seems to be correct, but clearly something is being changed.