Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the best way to invoke a 32-bit command with Shell.Run in VBScript such that it will succeed on both Windows 32-bit and 64-bit operating systems?

On 64-bit, the app terminates because it's not a 64-bit process. Whilst I could use c:\windows\syswow64\cscript.exe myscript.vbs, this isn't portable to Windows 32-bit.

share|improve this question
It would help if you showed us the relevant line(s) of code. – John Gardeniers Apr 7 '11 at 23:52

I can't reproduce the problem you're describing on my system. If I write a VBScript to invoke the 32-bit version of Notepad in %windir%\syswow64 using Shell.Run, it works just fine despite the fact that the scripting host is 64-bit and Notepad is 32-bit.

Set oShell = WScript.CreateObject("WScript.Shell")
oShell.Run "%windir%\syswow64\notepad.exe"

What 32-bit command are you trying to invoke that is failing?

share|improve this answer
+1, Same here... works fine. – Chris S Apr 8 '11 at 1:43
Except syswow64 does not exist on Windows 32-bit... so that particular example does not work. – jessicah Apr 9 '11 at 4:42
You said your problem only exists on 64-bit Windows. Why would a sample demonstrating the problem need to run on 32-bit Windows? The question I asked in my answer still stands. Perhaps if you posted your own script, we can analyze what's wrong. – Ryan Bolger Apr 9 '11 at 4:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.