Computer Hope

Microsoft => Microsoft Windows => Windows XP => Topic started by: associates on January 17, 2006, 07:28:34 PM

Title: how to trigger a script to run at a certain time
Post by: associates on January 17, 2006, 07:28:34 PM
Hi,

I've got a question here. I have a visual basic script that does a thing i want it to on my XP Pro machine. Is there a way of controlling the execution of the script like 2 minutes after a user is logged onto the computer.

Thank you in advance and look forward to hearing from you
Title: Re: how to trigger a script to run at a certain ti
Post by: Sidewinder on January 18, 2006, 05:52:22 AM
You might try putting a shortcut to your script in the C:\Documents and Settings\All Users\Start Menu\Programs\Startup folder. That should kick off your script at startup no matter who logs on.

For the two minute warning, try using a WScript.Sleep 120000 statement at the beginning of your script. You may have to adjust the time parameter (milliseconds). Many factors affect the Windows startup.

Hope this is helpful. 8-)
Title: Re: how to trigger a script to run at a certain ti
Post by: associates on January 19, 2006, 07:37:49 PM
Great, that works. Thank you, Sidewinder