I have a VBScript that should terminate the mspaint.exe process using a loop.
Dim oShell : Set oShell = CreateObject("WScript.Shell")
do
WScript.Sleep 3000
' Kill paint '
oShell.Run "taskkill /im mspaint.exe", , True
loop
It works, however every time it loops a command prompt window becomes the top-most and active window for about half a second and then closes. This is inconvenient because I would like this to run in the background.