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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now