Delay Run Comand in Startup Folder?

  • Thread starter Thread starter ewenste
  • Start date Start date
E

ewenste

I have lots of start up programs and would love to figure
how to make some of them delay a few seconds. Anyway to
do this without paying for software? Perhaps in the RUN
commands the shortcuts point to?
 
Ah, never mind. I figured how to write a .vbs to do this.

Here it is for anyone who might like to use it:

Set ss = WScript.CreateObject("WScript.Shell")
WScript.Sleep 7000
ss.run "C:\PROGRA~1\OUTLOO~1\msimn.exe"

This is 3 lines. It is set to run Outlook Express after a
7 second delay. Of course, it can be tailored to run any
program. Works like a charm.
 
Alright, this is the simple startup script I wrote to
manage most of my programs on startup. It also connects
my DSL, then opens OE and my browser (MYIE). Everything
is in my tray as I want it. I am new at scripts but it
works like a charm. Only MS-DOS file names worked, which
may be obvious to the more vbs-learned here. To get the
MS-DOS file names, I used Properties Plus
http://www.ne.jp/asahi/cool/kish/pplusmain.htm which is
small shell extension that has several neat uses. Others
can comment on whether there is a better way to write
this script, which would be welcomed, and others can
tweak it to their liking by changing the program entries
and sleep duration, and use it. It is 24 lines long.

Set ss = WScript.CreateObject("WScript.Shell")
WScript.Sleep 2000
ss.run "C:\PROGRA~1\ZONELA~1\ZONEAL~1\ZONEAL~1.EXE"
WScript.Sleep 8000
ss.run "C:\PROGRA~1\VISUAL~1\VISUAL~1.EXE"
WScript.Sleep 5000
ss.run "C:\PROGRA~1\Lavasoft\AD-AWA~1\Ad-watch.exe"
WScript.Sleep 300
ss.run "C:\PROGRA~1\POWERM~1\POWERM~1.EXE"
WScript.Sleep 300
ss.run "C:\PROGRA~1\ARMSOF~1\MACROM~1\MACROM~1.EXE"
WScript.Sleep 300
ss.run "C:\PROGRA~1\SHORTK~1\shortkey.exe"
WScript.Sleep 300
ss.run "C:\PROGRA~1\WordWeb\wweb32.exe"
WScript.Sleep 300
ss.run "C:\DOCUME~2\Owner\Desktop\MISCPR~1\NEKO95~1
\Neko95.exe"
WScript.Sleep 2000
ss.run "C:\WINDOWS\system32\rasphone.exe -d MyISP"
WScript.Sleep 5500
ss.run "C:\PROGRA~1\MYIE2\MyIE.exe"
WScript.Sleep 3000
ss.run "C:\PROGRA~1\OUTLOO~1\msimn.exe"
WScript.Sleep 300
ss.run "C:\DOCUME~2\Owner\Desktop\MISCPR~1\SYSRES~1.EXE"
 
ss.run Chr(34) & "C:\PROGRAM Files\ZONE Labs\ZONEALabs\ZONEALabs.EXE" & chr(34)

Chr(34) is an " and you have to type chr(34 ) whereever you want a ". This is because " is usen in the language to enclose strings.

Long file name need to be enclosed in "" most of the time

& concatinates strings. Use & not + cos if your strings are also numbers they'll be added.
 
Thanks. By doing what you showed one can use normal file
names, if I have you right (almost certain I do).

-----Original Message-----
ss.run Chr(34) & "C:\PROGRAM Files\ZONE
Labs\ZONEALabs\ZONEALabs.EXE" & chr(34)
Chr(34) is an " and you have to type chr(34 ) whereever
you want a ". This is because " is usen in the language
to enclose strings.
Long file name need to be enclosed in "" most of the time

& concatinates strings. Use & not + cos if your strings
are also numbers they'll be added.
 
Back
Top