How can I terminate process using vbscript. PLEASE NOTE, I need to terminate process that runs under windows 64-bit environment as native 64 (not using select * from win_32_Process)
Thanks,
The Win32_Process
class provides access to both 32-bit and 64-bit processes when the script is run from a 64-bit command shell.
If this is not an option for you, you can try using the taskkill
command:
Dim oShell : Set oShell = CreateObject("WScript.Shell")
' Launch notepad '
oShell.Run "notepad"
WScript.Sleep 3000
' Kill notepad '
oShell.Run "taskkill /im notepad.exe", , True
Just type in the following command: taskkill /f /im (program name) To find out the im of your program open task manager and look at the process while your program is running. After the program has run a process will disappear from the task manager; that is your program.
I know I am late to the game LOL, but this is what I did to kill SmartScreen.
Create text file KillSmartScreen.vbs
Edit with Notepad:
Dim oShell : Set oShell = CreateObject("WScript.Shell")
'Kill smartscreen.exe aka Windows Defender SmartScreen
oShell.Run "taskkill /f /im smartscreen.exe"
Double click KillSmartScreen.vbs to run.
Works like a champ.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With