VBS help - Program excution.

raksasas

Limp Gawd
2FA
Joined
Dec 14, 2002
Messages
477
I'm trying to get an program to execute in a VBS Script.
The desktop's shortcut target line to run it manually is:
"C:\Program Files\ILeads58\Rms\ILeads.exe" -t -cC:\PROGRA~1\ILeads58\UserConfigs/%username%.fpw

I can also run this line in the start/run:
"C:\Program Files\ILeads58\Rms\ILeads.exe" -t -c"C:\Program Files\ILeads58\UserConfigs/%username%.fpw"

Now on to the VBS part:
I have the following setup:

Dim sUserName, sCfgFile, sCmd
sUserName = sUserName = oShell.ExpandEnvironmentStrings("%UserName%")
sCfgFile = "C:\Program Files\ILeads58\UserConfigs\" & sUserName & ".fpw"
sCmd = "C:\Program Files\ILeads58\Rms\ILeads.exe -t -c" & sCfgFile '<---- Having issues with this line... needs to have the ""?????
Set oExec = oShell.Exec (sCmd)
 
sCmd = "C:\Program Files\ILeads58\Rms\ILeads.exe -t -c""" & sCfgFile & """"
 
That's what I thought.
This line also works.
sCmd = Chr(34) & "C:\Program Files\ILeads58\Rms\ILeads.exe" & Chr(34) & " -t -c" & Chr(34) & sCfgFile & Chr(34)
 
Okay i'm going to shound stupid here but just wanting to say it anyways.
Is there another way to execute the program in vbs? (just trying to cover my basics)

Reason.. I have a Batch file and a vbscript that do the same thing
if I used the batch file to execute the program I get no error and everything works.
Now, If I use the VBScript to execute the program the program produces errors (not the VBscript).
 
Back
Top