turbomcp Posted July 28, 2004 Share Posted July 28, 2004 hi im trying to run this script from runonceexe:function getWin(win, inc){var cntr = 0;while (!WshShell.AppActivate(win)){if (cntr==12) return true;cntr++;WScript.Sleep(inc);}return true;}var WshShell = new ActiveXObject("WScript.Shell");var oExec = WshShell.Exec("trueimage.exe");while (oExec.Status == 0){WScript.Sleep(1000);WshShell.SendKeys ("{ENTER}");WScript.Sleep(200);WshShell.SendKeys ("%{a}");WScript.Sleep(200);WshShell.SendKeys ("%{n}");WScript.Sleep(200);WshShell.SendKeys ("serial");WScript.Sleep(100);WshShell.SendKeys ("serial");WScript.Sleep(100);WshShell.SendKeys ("serial");WScript.Sleep(100);WshShell.SendKeys ("serial");WScript.Sleep(100);WshShell.SendKeys ("serial");WScript.Sleep(100);WshShell.SendKeys ("%{n}");WScript.Sleep(200);WshShell.SendKeys ("%{n}");WScript.Sleep(200);WshShell.SendKeys ("%{y}");WScript.Sleep(200);WshShell.SendKeys ("%{n}");WScript.Sleep(200);WshShell.SendKeys ("%{n}");WScript.Sleep(200);WshShell.SendKeys ("%{p}");WScript.Sleep(10000);WshShell.SendKeys ("%{y}");WScript.Sleep(200);WshShell.SendKeys ("%{n}");WScript.Sleep(500);WshShell.SendKeys ("%{y}");WScript.Sleep(200);WshShell.SendKeys ("%{f}");WScript.Sleep(200);WshShell.SendKeys ("%{c}");}WScript.quit();it runs ok when you execute it normally ,but when run from runoncexec it gets to the point of installing drivers(where it takes it alittle more time) and then i guess xp thinks its hanged or something and opens another runonceexec window and starts the next program in line after acronis.the problem is somehow after all programs run almost it gets out of this hngged state and continue the first runoncexec window and starts installing same programs again.i had the same thing with alcohol and it couldnt get rid of it untill i put it last on my programs listsany idea? Link to comment Share on other sites More sharing options...
LiquidSage Posted July 28, 2004 Share Posted July 28, 2004 The acronis trueimage mounter is not a cert. driver so you get the 'are you sure you wantt to continue...'. set your driver signing warning to 'ignore' and then try. Link to comment Share on other sites More sharing options...
turbomcp Posted July 28, 2004 Author Share Posted July 28, 2004 thanks but i have the ignore unnasigned in winnt.sif alreadythe problem is that windows "thinks" the script is overand starts the next programif i add sleep 10i see it runs sleep and then the other program,this means it thinks the jsscript is over Link to comment Share on other sites More sharing options...
mazin Posted July 28, 2004 Share Posted July 28, 2004 For a JS to work properly under RunOnceEX, you need to include the path in your JS.Therefore, I see your problem is here:var oExec = WshShell.Exec("trueimage.exe");It must be like this:var oExec = WshShell.Exec("%systemdrive%\\Install\\True\\trueimage.exe");Or whatever your path is.And, it's preferable to replace oExec and Exec with Run to avoid unexpected problems. So, your string should be like this:var Run = WshShell.Run("%systemdrive%\\Install\\True\\trueimage.exe");If you decide to replace them, then you'll have to delete this line:while (oExec.Status == 0)Also, take LiquidSage's idea into account.Plus, you used <function getWin> but you didn't define a window for your JS to work on. So, it worked on whatever window found in its way. Link to comment Share on other sites More sharing options...
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