Freigeben über


Are you running a 32-bit OS on your 64-bit capable machine?

I recently formatted my wife’s notebook in order to install Windows 7 Release Candidate (RC).  I was curious whether her system was 64-bit capable or not, so I whipped up the following script, which answered the question for me (yes, it was, btw).

This is a very basic script, but answered the question easy enough.  Hopefully, it can help you in some way as well:

On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
arrComputers = Array("localhost")

For Each strComputer In arrComputers
WScript.Echo
WScript.Echo "=========================================="
WScript.Echo "Computer: " & strComputer
WScript.Echo "=========================================="

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)

   For Each objitem in colitems
WScript.Echo objItem.DeviceID
WScript.Echo " DataWidth = " & objItem.DataWidth
WScript.Echo " AddressWidth = " & objItem.AddressWidth

If objItem.DataWidth > objItem.AddressWidth Then
WScript.Echo "Your hardware is 64-bit capable, but you are running on a 32-bit operating system."
End If
Next
Next

Simply save the above as a file and run it via “cscript <filename.vbs> ” as normal.