Hi everyone. I have a simple VBScript sample that kills a process by name. It works fine on every OS, X86 and 64 bits :
---------------------------kill process sample----------------------------------------
Set wsh = CreateObject("Wscript.Shell")
wsh.Run "calc.exe",1
Set Processes = GetObject("winmgmts:").InstancesOf("Win32_Process")
For each Process in Processes
Select Case LCase(Process.Name)
Case "calc.exe"
Process.Terminate(1)
---------------------------------------------------------------------------------------------
I tried the "for" loop, the "forEach" loop and "switch" in javascript but none of them work like in VBScript.
Could anyone help me converting this script sample to javascript, since VBScript became obsolete and God knows whether it will be available for HTA applications and Windows Script Host files in the near future.
Thanks a lot in advance.