Jump to content

Acronis jscript opens another window in runonce


turbomcp

Recommended Posts

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 lists

any idea?

Link to comment
Share on other sites


thanks but

i have the ignore unnasigned in winnt.sif already

the problem is that windows "thinks" the script is over

and starts the next program

if i add sleep 10

i see it runs sleep and then the other program,this means it thinks the jsscript is over

Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...