Sign in to follow this  
Followers 0
schmelle

How to detect a 64-Bit OS

19 posts in this topic

Hi,

has anybody an idea how to determine if a 64-Bit OS is running (like Windows XP-Pro-64 or Windows Server "Longhorn")?

I'm searching for a Macro like "@ProcessorArch" or a small script.

Thanks for your help... :lmao:

Peter


[font="Courier New"]Tell it - and I will forget it...Show it - and I will remember me...Share it - and I will understand it![/font]

Share this post


Link to post
Share on other sites



Hi,

has anybody an idea how to determine if a 64-Bit OS is running (like Windows XP-Pro-64 or Windows Server "Longhorn")?

I'm searching for a Macro like "@ProcessorArch" or a small script.

Thanks for your help... :lmao:

Peter

@ProcessorArch maybe?

:ph34r:

Share this post


Link to post
Share on other sites

@ProcessorArch maybe?

:lmao:

was added after this thread.... http://www.autoitscript.com/forum/index.php?showtopic=14565

Cheers

Kurt


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Hi,

A 64-Bit processor can run in 32-Bit Mode. So you are able to run a 32-Bit Windows on a 64-Bit processor. (Intel XEON Processor)

When you try to detect the OS with @OSVersion you will receive WIN_XP for example, but @ProcessorArch returns X64.

If you try to install Patches for different OS versions you must be able to detect if the OS is 64-Bit or 32-Bit.

Did the 64-Bit OS return other Build Version? (I haven't got a 64-Bit System but my script should not run on a 64-Bit system. So I had to check the OS version.) If yes, has anybody the Build numbers?

BR Peter


[font="Courier New"]Tell it - and I will forget it...Show it - and I will remember me...Share it - and I will understand it![/font]

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Hi,

A 64-Bit processor can run in 32-Bit Mode. So you are able to run a 32-Bit Windows on a 64-Bit processor. (Intel XEON Processor)

When you try to detect the OS with @OSVersion you will receive WIN_XP for example, but @ProcessorArch returns X64.

If you try to install Patches for different OS versions you must be able to detect if the OS is 64-Bit or 32-Bit.

Did the 64-Bit OS return other Build Version? (I haven't got a 64-Bit System but my script should not run on a 64-Bit system. So I had to check the OS version.) If yes, has anybody the Build numbers?

BR Peter

Well from what i tested ProcesorArch returns 32Bit or 64bit depending on Windows version and not actual state of your processor. I can test it in few minutes but i am sure i tested it some time ago.

Edit:

Just tested @ProcessorArch on Windows XP 32bit on Athlon64 returns X86. So i guess it's what you need :ph34r:

Func DetectInfrastructure()
    If @OSTYPE = "WIN32_WINDOWS" Then
        ;If @OSType = "WIN32_NT" Then
        _AddLineBox("Unsupported Windows version. Use only on 2000/XP/2003 x32/64.")
        $ErrorIsThere = "Yes"
    Else
        If @ProcessorArch = "X86" Then
            $HKLM = "HKEY_LOCAL_MACHINE"
            $devcon = $devcon32
            If @OSVersion = "WIN_XP" Then _AddLineBox("Detecting Windows version - Windows XP x32")
            If @OSVersion = "WIN_2000" Then _AddLineBox("Detecting Windows version - Windows 2000 x32")
            If @OSVersion = "WIN_2003" Then _AddLineBox("Detecting Windows version - Windows 2003 x32")
        EndIf
        If @ProcessorArch = "X64" Then
            $HKLM = "HKEY_LOCAL_MACHINE64"
            $devcon = $devcon64
            If @OSVersion = "WIN_XP" Then _AddLineBox("Detecting Windows version - Windows XP x64")
            If @OSVersion = "WIN_2000" Then _AddLineBox("Detecting Windows version - Windows 2000 x64")
            If @OSVersion = "WIN_2003" Then _AddLineBox("Detecting Windows version - Windows 2003 x64")
        EndIf
    EndIf
EndFunc   ;==>DetectInfrastructure

Replace _AddlineBox with your code :lmao:

Edited by MadBoy
1 person likes this

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

Wonderful, I'm waiting! :lmao:

Thanks Peter


[font="Courier New"]Tell it - and I will forget it...Show it - and I will remember me...Share it - and I will understand it![/font]

Share this post


Link to post
Share on other sites

Updated my last post.


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

Fantastic, thanks a million! :lmao::ph34r::geek:

Peter


[font="Courier New"]Tell it - and I will forget it...Show it - and I will remember me...Share it - and I will understand it![/font]

Share this post


Link to post
Share on other sites

Jon,

is it possible for you to describe the @ProcessorArch feature in the helpfile a little bit more?

Thanks a lot... :lmao:

Peter


[font="Courier New"]Tell it - and I will forget it...Show it - and I will remember me...Share it - and I will understand it![/font]

Share this post


Link to post
Share on other sites

me to, it always returns 86.

Share this post


Link to post
Share on other sites

me to, it always returns 86.

How about just looking for the "program files (x86)" directory?

-Jim

Share this post


Link to post
Share on other sites

In current version of AutoIt (v3.3.8.1), @ProcessorArch becomes @OSArch.

Share this post


Link to post
Share on other sites

Thanks, but this post is old and outdated. Please refrain from digging up old posts in the future.

2 people like this

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

That's just a selfish rule that was clearly introduced to avoid that you and other long time members have to deal with the same old post.

It also contradicts your own actions, because you don't delete this old thread (clearly because it could be useful to others with the same problem), yet at the same time you don't want others to keep it up to date! What kind of stupidty is that, because then what's the whole fucking point of leaving those threads alive, when you're almost cutting people's hands off when they touch it again years later and add useful information. Why the heck are you acting like some dictator when people dig up old conversations, is that the same kind of behavior you show in real life? And what do you think PPCC thinks about your actions, he's using his precious time to help others you fool!

Seriously....act normal... if it wasn't for PPCC I wouldn't have known it when I Googled and don't get me started about the thousands of other people finding these old posts and getting confused because you're constantly standing there with your whip, because God forbid if someone digs up an old old post!

13,340 posts...that's your poblem buddy. I see that a lot of with people like you with so many posts, they get really picky, they just want to see the excited stuff that interest THEM.

Go and develop some software dude if you want to walk around with "developer" and "developers" under your name and stop acting like a juvenile.

Edited by JMiles

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

That's just a selfish rule that was clearly introduced to avoid that you and other long time members have to deal with the same old post.

Go and develop some software dude if you want to walk around with "developer" and "developers" under your name and stop acting like a juvenile.

Hold your horses man...

The reason old topics shouldn't be revived after a year or more is because it's likely that it contains dated information that could no longer work, or be as efficient. We have your best interests in mind when we place rules on things like this.

guinness here deserves every letter you see under his name.

Devotion - to AutoIt

Evolution - to the Helpfile and the community

Veracity - it's just guinness

Evangelism - does he ever talk shit about AutoIt?

Love - he seriously loves what he does

Opinion - I, and many overs cherish his opinion

Person - at the end of the day, he's a person, like you and I and deserves the same amount of respect as I'm sure you'd want

Egghead - he's fucking brainy as shit.

Robot - I swear he never stops working on the helpfile and other parts that he does.

The same applies to other developers, past and present. Now leave it be.

Edited by James
2 people like this

Share this post


Link to post
Share on other sites

Well done James, superb response ... I admire your restraint ... me, I wouldn't have been so nice, first time poster or not. He clearly needs to learn some manners, especially as a first time visitor/member.

@JMiles - I suggest, that you spend a bit of time getting familiar with the place, before insulting well-respected members. We have oodles of topics that discuss post necroing ... you could learn a thing or three. Then leave if you don't like our policies.

Just think of who you attacked, when next using the Help file ... and hope we are a forgiving lot at the forum.


TheSaints' Robust Chat

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox

userbar.png

Share this post


Link to post
Share on other sites

@jmiles,

Not a great way to do an introduction.

PM me when you want to talk about it but this is your last outburst in public which was pretty much uncalled for.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0