OS and architecture

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

OS and architecture

#1 Post by avery_larry » 03 Nov 2010 13:11

Anyone know of a little utility or something that can reliably/easily determine OS and architecture? I would only care about win 2000 server, XP, and newer.

Here's something that I think would not be completely reliable:

https://www.barracudanetworks.com/ns/pu ... _order.php

Most notably, %processor_architecture% will show x86 if you're using the wow64 cmd.

Surely something reliable has to exist, right? I mean -- people who program software have to know what environment they're in when their software is installed . . . ??

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

Re: OS and architecture

#2 Post by !k » 03 Nov 2010 22:00

Last edited by !k on 04 Nov 2010 12:12, edited 1 time in total.

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

Re: OS and architecture

#3 Post by avery_larry » 04 Nov 2010 09:55

Nice. But I want the OS architecture -- not the physical architecture.

It's for assigning registry values. I need to distinguish between using the HKLM\Software directly or using HKLM\Software\WOW6432Node.

Right now I'm using:

Code: Select all

  :: onlyWin7 and noWin7 identify Windows 7 machines.
set onlyWin7=rem
ver|find /i "[Version 6.1"&&set nowin7=rem&&set onlywin7=


  :: only64/no64 identify 64 bit OS
set only64=rem
reg query HKLM\software|find /i "wow6432node">nul &&set no64=rem&&set only64=

It seems to work for me for now, as I only have 32 bit XP and 64 bit Win7. I have other methods to ignore servers.

!k
Expert
Posts: 378
Joined: 17 Oct 2009 08:30
Location: Russia

Re: OS and architecture

#4 Post by !k » 04 Nov 2010 12:18

Run systeminfo
and find "X86-based PC" or "X64-based PC"

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

Re: OS and architecture

#5 Post by avery_larry » 11 Nov 2010 12:32

That looks promising. Thanks.

Post Reply