"Pegasus [MVP]" <> wrote in message
news:...
>
> "Tyler Durden" <> wrote in message
> news:...
>> The following script runs normally on a x32 environment, and end without
>> finding the exe on a x64. What could be the issue?
>>
>> Dim WSHShell
>> Set WSHShell = CreateObject("WScript.Shell")
>> WSHShell.CurrentDirectory = WScript.ScriptFullName & "\.."
>> WSHShell.CurrentDirectory = WSHShell.CurrentDirectory &
>> "\my_program_folder"
>> WSHShell.Run "my_exe.exe /param1 /param2"
>>
>> Any help would be appreciated.
>
> Have you tried using a fully qualified path for your .exe file, instead of
> relying on a working directory that may or may not be correct?
>
If you are certain the exe is in the specified subfolder of the folder where
the VBScript is saved, perhaps something similar to this would work better:
===========
Dim WSHShell, strCmd
Set WSHShell = CreateObject("WScript.Shell")
strCmd = "%comspec% /c """ & Wscript.ScriptFullName _
& "\..\my_program_folder\my_exe.exe"" /param1 /param2"
Wscript.Echo strCmd
WSHShell.Run strCmd, 2
========
The statement to echo strCmd is for troubleshooting, to make sure the
command is correct. Note the path and file name are in quotes, and quotes in
a quoted string must be doubled.
--
Richard Mueller
MVP Directory Services
Hilltop Lab -
http://www.rlmueller.net
--