Jump to content

Many VBScript Commands not working in RunOnceEx..


Recommended Posts

Posted a similiar question in "Unattended Install" with no responses, so hoping people with a bit more understanding of vb script, who ready this category, may have some ideas...

Ive created a VBScript that I want to run in the RunOnceEx.cmd of my unattended install. Ive noticed that many commands in my script simply dont get executed when run from this.

I created a VBS Script that uses WShell.Sendkey to pass keyboard commands at a couple different portions of the runonceex and they dont seem to work at all... When I run the script normally from windows it does exactly what I want it to do.

As a test, I created a VBS script that opens notepad and passes it some text using the WShell.Sendkey command. Sure enough.. I launch it from windows and it works like a charm. I add this to the RunOnceEx registry and all it does is open notepad and doesnt actually pass the keys.

I also noticed it doesnt appear as though WScript.Sleep doesnt work either. Ive tried using a batch to call this script from runonceex as well with no luck.

Anyone have any idea as to whats so different about this part of windows that would not allow VBS scripts to function as they should??? There are a couple key points in my Unattended that having this functionality will truly help a ton, so Id really like to get to the bottom of this....

Thanks guys and sorry for the double post....

Link to comment
Share on other sites


Runonceex.cmd runs before the desktop and explorer.exe are fully loaded and running. Therefore some of your commands may not be interpreted correctly because the shell is not yet fully operational.

Try using Sleep.exe to have runonceex wait until the Shell is loaded before trying to run your script. Another option would be to move the script execution to the end of the runonceex commands right before cleanup runs.

Good luck.

Link to comment
Share on other sites

Youre the man tguy.. thats exactly what the problem was. Originally tried 30 secs, but it still didnt work... tried 50 and sure enough, works like a charm.

Thanks a ton... this is going to help out big time.

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...