Here's the rub: I have incorporated a check for the "Program Files (x86)" folder (a kind of 64-bit OS check). Since I have done this, I cannot get VMWare Infrastructure Client to run! When I create a test snippet with the same code and remove the objShell.Run command and replace it with a simple message box telling me what variables it has stored, everything is accurate. So, I simply cannot figure out how this is wrong...
Program Files check:
Set objShell = CreateObject("WScript.Shell") ProgFilesPath = objShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%")
This works wonderfully - on 64-bit machines, it returns
C:\Program Files (x86)
On 32-bit machines, it returns
However, when I try to pass any of the following, I get a Path not found error...
objShell.run ProgFilesPath & "\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\VpxClient.exe -s 192.168.1.201 -u root -p " & RootPassword.Value,1,False
PathTIE = chr(34) & objShell.ExpandEnvironmentStrings("%PROGRAMFILES(x86)%") & "\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\VpxClient.exe -s 192.168.1.204 -u root -p " & RootPassword.Value & chr(34) objShell.run PathTIE,1,False
I have tried different permutations of quotes, both with and without and I simply can't get it to work! Can someone tell me what I am doing wrong?
Thanks, in advance, for your help!