
'==============================================================
'                                                             '
' Simple registry example for detecting the windows operating '
' system type - 32 or 64 bit.                                 '
'                                                             '
'                           By Andy.                          '
'                                                             '
'==============================================================

'===================================================================
'                                                                  '
' If you include the windowssdk.inc file, you must have            '
' __winreg_inc__ before the windowssdk.inc file line.              '
'                                                                  '
' AND the Registry.inc file MUST be after windowssdk.inc           '
'                                                                  '
' Windowssdk.inc IS NOT NEEDED FOR THIS EXAMPLE, I just thought    '
' I would show you just in case you do use windowssdk.inc.         '
'                                                                  '
'===================================================================  

$define __winreg_inc__
$include "windowssdk.inc"
$include "Registry.inc"

string OSType = ""
string PrgramFilesLocation = ""


openconsole
print
print

'Read the registry entry that has x86 or x64 in it's string.
OSType = RegGetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion","BuildLabEx")

'Now you can check for either x86 or x64....
if instr(OSType,"x86")
   print "  Your operating system is 32 bit."
else
   print "  Your operating system is 64 bit."
endif

'This gives you the actual path to Program Files folder...
PrgramFilesLocation = RegGetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion","ProgramFilesDir")
print
print "  Your Prgram Files location is ",PrgramFilesLocation

print
print "  Press any key to close..."
print

do:until inkey$ <> ""
closeconsole
end




