Need help writting a Windows script file

So, I wanted to be able to control which order programs load when windows starts up.
I have a program called Startup.exe which shows which programs load on startup, and can let you choose to load, or not load them. You can also edit the parameters.
I also found a script StartupDelay.vbs which lets you load programs in the order you want, and have a delay to keep too many things from loading at once. Here’s the unmodified code

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

Ok here’s the path of one of the programs I want to run

“H:\Program Files\RAMpage\RAMpage.exe” M=100 T=600 A D=Y P=“H:\Program Files\RAMpage\RAMpageConfig.exe”

So how can I make ProgramToRun equal this path and parameters?

I’ve tried quoting it different ways, and so far, no success. Thank you.

Line 1: SecondsToDelay = “5”
Line 2: ProgramToRun = “iexplore” 'may need full path
Line 3: Wscript.Sleep(SecondsToDelay * 1000)
Line 4: Prog = Chr(34) & ProgramToRun & Chr(34)
Line 5: CreateObject(“WScript.Shell”).Run(Prog)

The simple answer:
On line 2, set ProgramToRun =
“H:\Program Files\RAMpage\RAMpage.exe” & Chr(34) & " M=100 T=600 A D=Y P=" & Chr(34) & “H:\Program Files\RAMpage\RAMpageConfig.exe”

A more complex answer:
On line 2, set ProgramToRun =
Chr(34) & “H:\Program Files\RAMpage\RAMpage.exe” & Chr(34) & " M=100 T=600 A D=Y P=" & Chr(34) & “H:\Program Files\RAMpage\RAMpageConfig.exe” & Chr(34)
Remove line 4.
On line 5, change Prog to ProgramToRun

Also, you can substitute:
“”“H:\Program Files\RAMpage\RAMpage.exe”" M=100 T=600 A D=Y P="“H:\Program Files\RAMpage\RAMpageConfig.exe”""
Into the complex answer on line 2

So, you’ve got either:

SecondsToDelay = “5”
ProgramToRun = “H:\Program Files\RAMpage\RAMpage.exe” & Chr(34) & " M=100 T=600 A D=Y P=" & Chr(34) & “H:\Program Files\RAMpage\RAMpageConfig.exe”
Wscript.Sleep(SecondsToDelay * 1000)
Prog = Chr(34) & ProgramToRun & Chr(34)
CreateObject(“WScript.Shell”).Run(Prog)

OR

SecondsToDelay = “5”
ProgramToRun = Chr(34) & “H:\Program Files\RAMpage\RAMpage.exe” & Chr(34) & " M=100 T=600 A D=Y P=" & Chr(34) & “H:\Program Files\RAMpage\RAMpageConfig.exe” & Chr(34)
Wscript.Sleep(SecondsToDelay * 1000)
CreateObject(“WScript.Shell”).Run(ProgramToRun)

OR

SecondsToDelay = “5”
ProgramToRun = “”“H:\Program Files\RAMpage\RAMpage.exe”" M=100 T=600 A D=Y P="“H:\Program Files\RAMpage\RAMpageConfig.exe”""
Wscript.Sleep(SecondsToDelay * 1000)
CreateObject(“WScript.Shell”).Run(ProgramToRun)

Your choice.

Dang, so many choices, thanks. For some reason the P=“H:\Program Files\RAMpage\RAMpageConfig.exe” was throwing me off (the extra sets of quotation marks), but I guess it’s no problem at all. Thanks.

You are welcome. For the record, to put a quotation mark in a string, just put two double quotation marks together ("") inside the string. Otherwise, you can put Chr(34) + “String” + Chr(34)

Thanks.
If you wouldn’t mind, one last question, do you have any idea for this problem I’m encountering? I made the script file, and test ran it, but for some reason, even though the path and filename are completely correct
CreateObject(“WScript.Shell”).Run(“H:\Program Files\Creative\SB Live! 24-bit\Surround Mixer\CTSysVol.exe /r”)
returns the error “System can’t find the file specified”. :confused:

I don’t have a solution, but try removing the /r switch - it’s possible it’s interpreted as being part of the filename string, thus causing a failure.

I had a similar problem once, but I’m afraid I don’t recall how I solved it.

Not sure if this is required in XP/2000 but I know in 95/98 sometimes it would have problems with long directory names. Might want to try the 8 character dir names instead. I haven’t done any programing for a long long time so this might no longer be a problem.

(“H:\Progra~1\Creative\SB Liv~1\Surrou~1\CTSysVol.exe /r”)
If 2 or more dir start with the same letters then use ~2 ~3 etc. They are sorted alphabetically for the number extention.

-Otanx

Thank you Nanoda and Otanx, but those didn’t work. Oh well, I have the weekend to fiddle around and see if I can come up with someting that works.