English

Problem: VBScript and JScript geoprocessing scripts do not run on a 64-bit Windows OS

Description

VBScript and JScript geoprocessing scripts do not run on supported 64-bit (x64) Windows operating systems.

Cause

On a 64-bit platform, 64- and 32-bit code cannot be combined. A 64-bit script cannot launch a 32-bit process. ArcGIS Desktop and ArcGIS Server are native 32-bit applications, so they run as a 32-bit application on a 64-bit operating system.

When creating a geoprocessing script with VBScript or JScript, use the scripting environment's standard call for initiating IDispatch objects to create the geoprocessor object to run these scripts. 64-bit Windows, by default, uses the 'Wscript.exe' 64-bit executable. The geoprocessing object cannot be initialized because it is located in the 32-bit portion of the registry.

Solution or Workaround

The 64-bit versions of Windows include the WOW64 emulator to redirect to certain portions of the registry so that 32-bit code can be run. To run a 32-bit script, use the 'Wscript.exe' executable that is found in the \Windows\SysWOW64 directory. This runs the script in a 32-bit environment.

Run the script with Wscript.exe
1. Open the command prompt by either pressing 'Windows + R' or selecting the Start menu and selecting Run.

2. In Run, type 'CMD' and click OK.

3. Run the script by using the 'Wscript' executable in the \Windows\SysWOW64 directory. For example:

\windows\syswow64\wscript c:\test\BufferExample.vbs

Run the script from the 32-bit Command Prompt
1. Open the command prompt by either pressing 'Windows + R' or selecting the Start menu and selecting Run.

2. In Run, type '\windows\syswow64\cmd' and click OK.

3. Run the script by entering its location and name. For example:

c:\test\BufferExample.vbs

The file associations in Windows can always be reset, so they always run scripts in a 32-bit environment. However, this may cause problems for scripts that exploit any 64-bit functionality.

Note:
At ArcGIS 9.2, there is native Python support for geoprocessing scripting. Using this module avoids having to use Pythonwin to run geoprocessing scripts.

Related Information