PROBLEM

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

Last Published: February 13, 2024

Description

Note: 
Support for Visual Basic for Applications (VBA) for ArcMap and ArcCatalog ended with the ArcGIS 10.2.2 release, and Esri has not included VBA compatibility setups since version 10.5. See: ArcGIS Desktop and VBA Moving Forward

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

Note:
These instructions are for ArcGIS 9.x. ArcGIS version 10.0 is the last version of ArcGIS to support Microsoft Visual Basic for Applications (VBA).

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.

Article ID:000009695

Software:
  • ArcGIS Server

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic