I'm having trouble creating a small AutoHotkey script to end all vsjitdebugger.exe processes on a test server. Here's the code I have:
Process, Exist, vsjitdebugger.exe
NewPID = %ErrorLevel%
if NewPID = 0
{
MsgBox Process doesnt exist
}
else
{
MsgBox Process exists
}
Process, WaitClose, vsjitdebugger.exe, 5
NewPID = %ErrorLevel%
if NewPID = 0
{
MsgBox Process no longer exists
}
else
{
MsgBox Process still exists
}
When run the script tells me that the (vsjitdebugger.exe) process exists, as I would expect, but when WaitClose happens it still tells me that process(es) exist, and when I look in the Task Manager the same amount of vsjitdebugger.exe processes are still running.
I am able to end the vsjitdebugger.exe processes manually using Task Manager.
Basically I am unable to end these processes. Could anyone help me with this? Thanks.
Update: I've also tried this simple loop too, but with no avail:
Loop, 100
{
Process, Close, vsjitdebugger.exe
}
Update 2: I tried the following code suggested below, but it just stays in the loop forever and no processes are killed:
Loop
{
Process, Close, vsjitdebugger.exe
Process, wait, vsjitdebugger.exe, 0.1
NewPID = %ErrorLevel%
if NewPID = 0
{
break
}
}