 			}
 		GuiControl, PrgLnch:, RunBatchPrg, &Run Batch
 		}
-	}
-
-	if (lnchPrgIndex && (lnchStat == 1) && (temp := RevertResLastPrgProc(maxBatchPrgs, PrgMonPID, (lnchPrgIndex > 0)? 0: 1)))
-	{
-		if (DefResNoMatchRes())
-		{
-		ChangeResolution(dispMonNames, regoVar, temp)
-		sleep, 1000
-		}
+
+	; Update PrgMonBak
+	if (lnchStat == 1)
+	RevertResLastPrgProc(maxBatchPrgs, PrgMonPID, 1)
+
 	}
 
 

	{
		if (DefResNoMatchRes())
		{
		ChangeResolution(dispMonNames, regoVar, temp)
		sleep, 1000
		}

		PrgPIDtmp := PrgListPID[prgIndex]
		PrgMonPID.Delete(PrgPIDtmp)
		PrgListPID[prgIndex] := 0

		;do not set PrgPID to 0 as it may be running in the frontend.
		}

		if (PrgPIDtmp && (PrgPIDtmp != "FAILED") && (PrgPIDtmp != "NS") && (PrgPIDtmp != "TERM") && (PrgPIDtmp != "ENDED"))
		{
		temp := GetProcFromPath(PrgPaths)
		Process, Exist, %PrgPIDtmp%
