VBScript : Find Windows Hardware Architecture

VBScript : Find Windows Hardware Architecture

The following VBscript will establish whether the local system is x86 or x64 and enable you to execute further commands based upon this. Simply copy the code into a new .vbs file and add the additional steps within the if statement.

Set WshShell = WScript.CreateObject(“WScript.Shell”)
Architecture = WshShell.RegRead(“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE”)

If Architecture = “AMD64” Then
   ’64 bit OS
    wscript.echo “64-bit OS”
ElseIf Architecture = “x86” Then
  ’32 bit OS
   wscript.echo “32-bit OS”
End If