I can’t get a function to work. It should check if Iexplore.exe is running, if it’s running then wait. If not then run the Script.
I’m not sure how to add wait function in.
function main() {
var ieinfostate = false;
var iewait = setInterval(function () {
if (ProcessesRunning("iexplore.exe") != 1) {
clearInterval(iewait);
dosomethingelse();
} else if (ieinfostate == false) {
since you are using jscript, there is a sleep() method. thought.. thats the worst you could use since javascript is designed to be async.
you could do it like this:
sadly a timer is the only way to wait for closing of a process in windows.
microsoft fails hard at implementing usefull api’s like process state change events etc in jscript.
if you would like to have it clean you should consider using c, c++ or c#