Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delay Startup Launch of Program 1

Status
Not open for further replies.

Pleonasm

Technical User
May 20, 2004
121
CA
I am seeking to delay the launch of one specific program whose shortcut is included within the Startup folder (C:\Documents and Settings\<user>\Start Menu\Programs\Startup) by a specified number of seconds.

A general purpose utility that performs this function would, of course, work well. However, since my need to limited to one specific program, I suspect that this could be accomplished by a VBS script whose parameters (delay, program path & name) could be edited.

Can anyone kindly offer such a VBS script template? Or, alternatively, references to utilities or approaches to accomplish the objective?

Thank you for your assistance.
 
Here is a script I found at billsway.com (which I tried and it works). It runs two programs, but can be edited to run just one. Save it as a .VBS file using Notepad, edit as necessary, and put in your startup folder.

'StartupDelay.vbs - Sequentially run programs at Windows startup.
'Edit for your programs and delay, and put a shortcut to this
'script in your Startup folder. Full path to program may be needed.
'Copy and paste the 5 lines for adding more programs.
'© Bill James - bill@billsway.com - created 4 Nov 2002

SecondsToDelay = "5"
ProgramToRun = "iexplore" 'may need full path
Wscript.Sleep(SecondsToDelay * 1000)
Prog = Chr(34) & ProgramToRun & Chr(34)
CreateObject("WScript.Shell").Run(Prog)

SecondsToDelay = "10"
ProgramToRun = "winword" 'may need full path
Wscript.Sleep(SecondsToDelay * 1000)
Prog = Chr(34) & ProgramToRun & Chr(34)
CreateObject("WScript.Shell").Run(Prog)
 
Frank4d, the script you provided was *exactly* what I was seeking, and it works well.

Thank you very much for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top