Even on 64-bit version of Windows you script can execute in 32-bit mode.
You can use following code to determine real bit mode, you script running on:
option explicit
function Determine64BitMode
dim Shell, Is64BitOs
set Shell = CreateObject("WScript.Shell")
on error resume next
Shell.RegRead "HKLMSoftwareMicrosoftWindowsCurrentVersionProgramFilesDir (x86)"
Is64BitOs = Err.Number = 0
on error goto 0
if Is64BitOs then
Determine64BitMode = InStr(Shell.RegRead("HKLMSoftwareMicrosoftWindowsCurrentVersionProgramFilesDir"), "(x86)") = 0
else
Determine64BitMode = false
end if
end function
dim ExecutingIn64BitMode
ExecutingIn64BitMode = Determine64BitMode
if ExecutingIn64BitMode then
MsgBox "64 bit"
else
MsgBox "32 bit"
end if
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…