A script ..:)
Hello !
Can someone help me with a script , that can stop processes ( by PID , SID ) , on Windows , on Linux , Unix- like ? .. using kill .. system("kill ")..
I mean stop running proceses by PID on a Linux , Unix , or a Windows OS.
Thank's in advance ..
Can someone help me with a script , that can stop processes ( by PID , SID ) , on Windows , on Linux , Unix- like ? .. using kill .. system("kill ")..
I mean stop running proceses by PID on a Linux , Unix , or a Windows OS.
Thank's in advance ..
Optimism is an occupational hazard of programming: feedback is the treament. (Kent Beck)
Comments
-
blackzone Member Posts: 82 ■■□□□□□□□□You said it yourself, using "kill" on linux/Unix, I don't know what more you want.
For window, I have no idea, probably some VBscript which I never use before. -
Smallguy Member Posts: 597is this what you looknig for
http://www.windowsitpro.com/Article/ArticleID/13570/13570.html
or do u mean
using net start "precessname" or net stop "processname" -
Danman32 Member Posts: 1,243You would have to get the KILL utility though. I don't think it comes with Windows.
-
sprkymrk Member Posts: 4,884 ■■■□□□□□□□I would use the pstools from sysinternals:
http://www.sysinternals.com/Utilities/PsTools.html
Pslist will show you running processes, there name and PID. Pskill will let you kill a process by name or PID.
They trump the windows resourse kit tools by being able to execute against a remote machine as well as local. Not sure how you would "script" it though, since you would need to know in advance what the PID or name is before you kill it. If you had a specific process in mind, like say you want to make sure spyware.exe is not running on any machine, you could simply use the name and batch it like this:
for /f %%c in (c:\temp\computerlist.txt) do pskill \\%%c spyware.exe
This assumes you have a text file of the computers you want to run pskill on in the specified location.All things are possible, only believe.