Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to determine if system is 32 or 64 bit?

Apr
1,825
17
I am about to upgrade from XP to Winhave looked at the help file and can't see if or how it's possible to determine if it's 32 or 64 bit. Would @Winapi[???] be the right call?
 
Would %_X64 help you?
 
Would %_X64 help you?

%_X64 doesn't appear in TCMD 8.x and I need to find out in a way that is backwords copatible to version 8.x. I did find:

_WOW64 returns 1 if the command processor is running in the WOW64 environment (64-bit Windows).

and I need to see if Windows is 32 or 6, not caring if it's the 32 or 64 bit version of TCMD that is running.
 
Some time ago I needed some infos about the running windows without invoking tcmd/tcc :nailbiting: .
I made up a little autoit script which I compiled as console-application (checking "console?" in aut2exe).
I stuffed it with some autoit macros, e.g. "OSArch".
This is how it works:
Code:
(system)  C:\TEMP >autoitinfo $osa
X64
 
(system)  C:\TEMP >autoitinfo Hello $b %username , $+ "you are currently working with a " $osa "-Windows".
Hello Frank,
you are currently working with a X64-Windows.
This is the source code:
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; autoitinfo.au3
; fj 2011-05-25
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
dim $par, $parnum, $string
 
$parnum = $CmdLine[0]
for $i = 1 to $parnum
$par = $CmdLine[$i]
 
Switch $par
;;;;;;;;;;;;;;;;;;;;;;;;;;; special characters
Case "$tab"
                $string = $string & @TAB
Case "$B"
                $string = $string & " "
Case "$+"
                $string = $string & @CRLF
Case "$qm"
                $string = $string & '"'
;;;;;;;;;;;;;;;;;;;;;;;;;;; systeminfo
Case "$cpu"
                $string = $string & @CPUArch
Case "$ost"
                $string = $string & @OSType
Case "$osv"
                $string = $string & @OSVersion
Case "$osb"
                $string = $string & @OSBuild
Case "$osa"
                $string = $string & @OSArch
Case "$ossp"
                $string = $string & @OSServicePack
Case "$ip"
                $string = $string & @IPAddress1
Case "$user"
                $string = $string & @UserName
Case "$comspec"
                $string = $string & @Comspec
;;;;;;;;;;;;;;;;;;;;;;;;;;; date
case "$datetime"
                $string = $string & @YEAR & @MON & @MDAY & "_" & @HOUR & @MIN & @SEC
case "$date"
                $string = $string & @YEAR & @MON & @MDAY
case "$C"
                $string = $string & StringLeft( @YEAR, 2 )
case "$y"
                $string = $string & StringRight( @YEAR, 2 )
case "$m"
                $string = $string & @MON
case "$D"
                $string = $string & @MDAY
;;;;;;;;;;;;;;;;;;;;;;;;;;; Time
case "$time"
                $string = $string & @HOUR & @MIN & @SEC
case "$mi"
                $string = $string & @MIN
case "$h"
                $string = $string & @HOUR
case "$s"
                $string = $string & @SEC
case "$w"
                $string = $string & @WDAY
case "$z"
                $string = $string & @YDAY
;;;;;;;;;;;;;;;;;;;;;;;;;;; directories
Case "$cwd"
                $string = $string & @WorkingDir
case "$dw"
                $string = $string & @Windowsdir
case "$ds"
                $string = $string & @SystemDir
case "$dt"
                $string = $string & @TempDir
case "$dp"
                $string = $string & @ProgramFilesDir
case "$dc"
                $string = $string & @CommonFilesDir
case "$stmd"
                $string = $string & @StartMenuCommonDir
case "$ustmd"
                $string = $string & @StartMenuDir
case "$dtd"
                $string = $string & @DesktopCommonDir
case "$udtd"
                $string = $string & @DesktopDir
case "$docd"
                $string = $string & @DocumentsCommonDir
case "$udocd"
                $string = $string & @MyDocumentsDir
case Else
                $string = $string & $par
EndSwitch
Next
ConsoleWrite( $string & @CRLF )
Use it on your own risk.
 
Code:
  IFF "%PROCESSOR_ARCHITECTURE%" EQ "x86" then
    Echo System has a 32-bit processor
  elseiff "%PROCESSOR_ARCHITECTURE%" EQ "x64" then
    echo System has a 64-bit processor
  else
    echoerr System not known..... Get it serviced
    QUIT
  endiff
 
Back
Top
[FOX] Ultimate Translator
Translate