Francesco Posted July 21, 2013 Posted July 21, 2013 (edited) Remove from jscript.js:function TimedWaitForProgram(ImageName,HowLong){ position="jscript.js";whatfunc="TimedWaitForProgram()";var Elapsed=3;Pause(3,0);while (Elapsed<=HowLong*60){ var oExec = WshShell.Exec('tasklist.exe'); while (oExec.Status == 0) Pause(0,100); var Output = oExec.StdOut.ReadAll() + oExec.StdErr.ReadAll(); if (Output.search(ImageName)==-1) return; Pause(3,0); Elapsed += 3;}}At the bottom of WMI.js add:function TimedWaitForProgram(ImageName,HowLong){ position="wmi.js";whatfunc="TimedWaitForProgram()";try{ objWMIService=GetObject("winmgmts:\\\\" + "." + "\\root\\CIMV2"); var Elapsed=0; while (!HowLong || (Elapsed<=HowLong*60)) { colItems=objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name='"+ImageName+"'"); if (colItems.Count > 0) return true; Pause(1,0); Elapsed += 1; }}catch(ex){}return false;} Edited July 21, 2013 by Francesco
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now