Running VBScripts in 64-bit Windows Installations

The VBScript interpreter (cscript.exe/wscript.exe) comes in two versions on a 64-bit version of Windows: a 32-bit version and a 64-bit version. The 32-bit version can create and use 32-bit COM components only. The 64-bit version can create and use only 64-bit COM components. By default, .vbs files are associated with the 64-bit version.

Twin Builder scripting executables are 32-bit and must be created through the 32-bit VBScript interpreter.

You can find the 32-bit version of the VBScript interpreter in the <windows>\SysWOW64 folder. Launching this version should give you access to all 32-bit COM components. In the scripting examples provided with Twin Builder (located in <installdir>\Examples\Twin Builder\Applications\Scripting), there are BAT files that run the WScript appropriate to the operating system.

In general, a VBScript can be run on either 32-bit or 64-bit Windows operating systems by using the following BAT file template (all on one line):

if exist %WINDIR%\SysWOW64 (%WINDIR%\SysWOW64\wscript.exe
<yourScriptFile>.vbs) else (%WINDIR%\System32\wscript.exe
<yourScriptFile>.vbs)