windows - Javascript Process Kill with pass in name -


I am trying to create a small javascript code that kills the process that runs on my windows machine (i But the server should be running in production in 2003) but I started with the following code:

  w = New ActiveXObject ("WScript.Shell"); W.run ("taskkill.exe / im iexpore.exe"); Back true;   

I need to make that process that anything that I pass is destroyed.

I now have the following code, but it still does not work:

  dim prcid Dim Check Inp Set Inp = WScript.Arguments check = 0 objService = GetObject ("winmgmts:") set objService.InstancesOf ("Win32_process") for each process if the process.name = "Inp" then exit prcid = process.processid check = 1 end next if check = 0 then WScript .quuit [ExitCode] ends if objService.InstancesOf ("Win32_process") for each process, if process.name = "Inp" then if process.processid = prcid then strComputer = "." ObjWMIService = GetObject (set "winmgmts:" _ "and" {impersonation level = impersonation}! \\ "& amp; Strip computer & amp;" \ root \ cimv2 ") Set ColProcessList = objWMIService.ExecQuery _ (" SELECT * FROM Win32_Process WHERE Name = 'ENP' ") In each object process, call process list objProcess.Terminate () for next termination if left for the end Next    

  for objArgs = WScript.Arguments; (i = 0; i   

I think that you want to pass the process that you want to kill in the script as a parameter.

T.

Comments