1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to determine if system is 32 or 64 bit?

Discussion in 'Support' started by Charles G, Dec 12, 2012.

  1. Charles G

    Joined:
    Apr 2, 2011
    Messages:
    1,019
    Likes Received:
    0
    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?
     
  2. Frank

    Joined:
    Aug 2, 2011
    Messages:
    258
    Likes Received:
    4
    Would %_X64 help you?
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    9,856
    Likes Received:
    83
    What are you trying to find out -- if Windows is 64-bit (%_WOW64DIR) or if Take Command is 64-bit (%_x64)?
     
  4. Charles G

    Joined:
    Apr 2, 2011
    Messages:
    1,019
    Likes Received:
    0
    %_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.
     
  5. Frank

    Joined:
    Aug 2, 2011
    Messages:
    258
    Likes Received:
    4
    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.
     
  6. Charles G

    Joined:
    Apr 2, 2011
    Messages:
    1,019
    Likes Received:
    0
    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
    
     

Share This Page