Reputation: 15
Im trying to start an executable with an Ini file.
We need this, so we can start lotus notes as the ini files is needed for the datapath.
The shortcut is notes.exe =h:\lotus\notes\notes.ini
.
I tried the following script
Set objShell = WScript.CreateObject("WScript.shell")
objShell.run "%comspec% /c "C:\Program Files (x86)\IBM\Lotus\Notes\notes.exe"
=h:\lotus\notes\notes.ini
Is there another way to do this?
Upvotes: 1
Views: 724
Reputation: 200273
%COMSPEC%
is not required, but you need double quotes around the program path (because it contains spaces), and you must escape them (by prepending them with another double qoute), because they're inside a string. Without escaping you get a string "%comspec% /c "
followed by an invalid "operator" C:\Program
and other garbage.
Change this:
objShell.run "%comspec% /c "C:\Program Files (x86)\IBM\Lotus\Notes\notes.exe" =h:\lotus\notes\notes.ini
into this:
objShell.run """C:\Program Files (x86)\IBM\Lotus\Notes\notes.exe"" =h:\lotus\notes\notes.ini"
and the problem should disappear.
Upvotes: 1