' Prozess aus QB heraus stoppen DECLARE SUB StoppeProzess (procn$) PRINT "Bitte einen Windows-Taschenrechner starten..." d$ = INPUT$(1) PRINT "Wir stoppen ihn gleich..." StoppeProzess "calc.exe" PRINT "Rechner gestoppt" SUB StoppeProzess (procn$) OPEN ENVIRON$("TEMP") + "\~TKILL.VBS" FOR OUTPUT AS 1 PRINT #1, "Set oWmi = GetObject(" + CHR$(34) + "winmgmts:" + CHR$(34) + ")" PRINT #1, "Set colIEPrc = oWmi.ExecQuery(" + CHR$(34) + "Select * from Win32_Process" + CHR$(34) + ")" PRINT #1, "bGef = False" PRINT #1, "For Each oPrc In colIEPrc" PRINT #1, " If oPrc.name = " + CHR$(34) + procn$ + CHR$(34) + " And Not bGef Then" PRINT #1, " Set oPrc2 = oPrc" PRINT #1, " bGef = True" PRINT #1, " End If" PRINT #1, "Next" PRINT #1, "If bGef Then" PRINT #1, " oPrc2.Terminate" PRINT #1, " Set oPrc2 = Nothing" PRINT #1, "End If" PRINT #1, "Set colIEPrc = Nothing" PRINT #1, "Set oWmi = Nothing" CLOSE 1 SHELL "CSCRIPT //NoLogo " + ENVIRON$("TEMP") + "\~TKILL.VBS" KILL ENVIRON$("TEMP") + "\~TKILL.VBS" END SUB