How do i detect the bitness (32-bit vs. 64-bit) of the Windows OS in VBScript?
I tried this approach but it doesn’t work; I guess the (x86) is causing some problem which checking for the folder..
Is there any other alternative?
progFiles="c:\program files" & "(" & "x86" & ")"
set fileSys=CreateObject("Scripting.FileSystemObject")
If fileSys.FolderExists(progFiles) Then
WScript.Echo "Folder Exists"
End If
You can query the
PROCESSOR_ARCHITECTURE. A described here, you have to add some extra checks, because the value ofPROCESSOR_ARCHITECTUREwill bex86for any 32-bit process, even if it is running on a 64-bit OS. In that case, the variablePROCESSOR_ARCHITEW6432will contain the OS bitness. Further details in MSDN.