In a VBS installation script, how do I use the 32 bit version of Wscript on a 64 bit machine?

Posted on 2011-03-04
Last Modified: 2012-05-11
I have this line in an installation script that was designed for use with 32 bit machines.
set wshshell=wscript.createobject("")

Its my understanding that when I run this in a 64 bit environment that the 64 bit version of wscript will be used by default.  How do I force it to use the 31 bit version in VBscript?

Thank you!
Question by:RichardRiga
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 14

Accepted Solution

Tribus earned 250 total points
ID: 35036668
You could try using compatibility mode for the program...

Right-click on the application .exe and select Windows 98 or XP not sure if this will work but I know there was no x64 version of 98...?

What I would do really though is get a copy of Virtual PC and install a 32-bit version of the OS of choice and run the application from the VM as needed.

Important info reguarding this from MS:

What do I have to do with my 32-bit Windows applications so they will run?

Most 32-bit Windows applications just work. The application does not need to be changed and nothing needs to be configured in the OS.

Occasionally an application may complain that it runs only on Windows 95 or one of the other Windows OSs. The "Compatibility mode" of that program can be modified by opening the program Properties, select the Compatibility tab, and set the "Compatibility mode" to the requested OS. This will "fool" the application into thinking it is running on one of the other OSs. Note this does not always work, see below.

What are some common Windows 32-bit application compatibility issues?

Some applications require a 32-bit driver. The software can install but the driver can not. For example, most anti-virus software uses a file system filter driver. On x64 all drivers, including file system filters, must be 64-bit. The 32-bit antivirus software can not install their file system filter driver and will not function. Note that 64-bit anti-virus software exists today and other vendors will have solutions later in 2005 or 2006.

Some applications may be coded to only run on a specific version of the OS. If the detected OS is not one of the allowable types the application will not execute. Sometimes adjusting the "Compatibility mode" described above will work around this. If "Compatibility mode" does not work the software vendor must provide an updated application that allows the application to run.

Many application installers include a 16-bit stub to identify the machine type and start a 32-bit install engine. The 16-bit portion of the installer will fail since none of the Windows 64-bit OSs can execute 16-bit code. Microsoft has identified this as a critical blocker to x64 adoption. To overcome this 64-bit Windows detects specific 16-bit installers and transparently instantiates an equivalent 32-bit version if one is available. Note that the 64-bit Windows Installer can seamlessly install 32-bit MSI-based applications on 64-bit Windows.

Links: (The info from this link is what I posted above)

Hope this helps!

LVL 10

Assisted Solution

Martin_J_Parker earned 250 total points
ID: 35036682
Use C:\Windows\Syswow64\wscript.exe to start 32bit wscript.exe on Win64.

Strictly speaking it should be %windir%\SysWoW64\wscript.exe just in case you aren't booting from C: in a multi-boot environment - but for most people that will be the same as C:\Windows\Syswow64\wscript.exe anyway.
LVL 14

Expert Comment

ID: 35036698
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

LVL 14

Expert Comment

ID: 35036714
The article I posted above is basically saying the same thing as Martin's post, but in a bit more detail.  We must have been typing at the same

LVL 10

Expert Comment

ID: 35036737
That's often the case with this site - several people give the same answer in quick succession because they were typing it up at the same time.  As the French would say, That's life!

Author Closing Comment

ID: 35074161
Thank you guys.  Sorry it took a while, but there you have it.  Both posters pointed me in the direction that ultimately help me solve my specific proglem.  Take care!

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  ( Here (http…
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question