I need to stop a changing list of processes on local machines. I'd like to be able to just add to list within the script when I have a new process name. Currently, I just write the guts of the script over and over. I've gotten close with a sub routine that works for deleting files. I just edited to use PSKill and try to kill the processes with a variable but no luck with my example below:
Dim shell
Set shell = CreateObject("WScript.Shell")
call ProcName("Winword.exe")
call ProcName("notepad.exe")
wscript.quit
sub ProcName(ProcessName)
shell.Run (("pskill.exe /t (Processname)"))
end sub
'End Example
Any help with any manner of completing this task (with or without PSKill) with vbs is appreciated.
Thanks!
-Steve
Dim shell
Set shell = CreateObject("WScript.Shell")
call ProcName("Winword.exe")
call ProcName("notepad.exe")
wscript.quit
sub ProcName(ProcessName)
shell.Run (("pskill.exe /t (Processname)"))
end sub
'End Example
Any help with any manner of completing this task (with or without PSKill) with vbs is appreciated.
Thanks!
-Steve