Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows XP » microsoft.public.windowsxp.basics
Thread: How to find the 32 & 64 bit OS type in a cmd file

HTVi
TV Discussion Newsgroups

How to find the 32 & 64 bit OS type in a cmd file
"BrianB" <brian[ at ]notreal.com> 11/12/2008 1:30:18 AM
I'm modifying a cmd script and need to know which type of Windows it's
running and if it is 32 or 64 bit. I've found several sites suggesting that
the ver command works to find the OS, but the suggestions do not cover all
version of XP and Vista. By trial and error I have ...

ver | find "2003" > nul
if %ERRORLEVEL% == 0 goto ver_2003
ver | find "Vista" > nul
if %ERRORLEVEL% == 0 goto ver_vista
ver | find "Microsoft Windows [Version 6.0" > nul
if %ERRORLEVEL% == 0 goto ver_xp
ver | find "XP" > nul
if %ERRORLEVEL% == 0 goto ver_xp
ver | find "Microsoft Windows [Version 5.2" > nul
if %ERRORLEVEL% == 0 goto ver_xp
ver | find "2000" > nul
if %ERRORLEVEL% == 0 goto ver_2000
ver | find "NT" > nul
if %ERRORLEVEL% == 0 goto ver_nt
echo Machine undetermined.
goto error

But I cannot find any definitive list of what ver returns for each OS. For
64-bit XP the ver output does not include the string "XP".

I haven't a clue how to determine if its a 32-bit or 64-bit OS.

Any suggestions?
Brian Bygland


Re: How to find the 32 & 64 bit OS type in a cmd file
Big_Al <BigAl[ at ]md.com> 11/12/2008 1:39:49 AM
BrianB wrote:
[Quoted Text]
> I'm modifying a cmd script and need to know which type of Windows it's
> running and if it is 32 or 64 bit. I've found several sites suggesting that
> the ver command works to find the OS, but the suggestions do not cover all
> version of XP and Vista. By trial and error I have ...
>
> ver | find "2003" > nul
> if %ERRORLEVEL% == 0 goto ver_2003
> ver | find "Vista" > nul
> if %ERRORLEVEL% == 0 goto ver_vista
> ver | find "Microsoft Windows [Version 6.0" > nul
> if %ERRORLEVEL% == 0 goto ver_xp
> ver | find "XP" > nul
> if %ERRORLEVEL% == 0 goto ver_xp
> ver | find "Microsoft Windows [Version 5.2" > nul
> if %ERRORLEVEL% == 0 goto ver_xp
> ver | find "2000" > nul
> if %ERRORLEVEL% == 0 goto ver_2000
> ver | find "NT" > nul
> if %ERRORLEVEL% == 0 goto ver_nt
> echo Machine undetermined.
> goto error
>
> But I cannot find any definitive list of what ver returns for each OS. For
> 64-bit XP the ver output does not include the string "XP".
>
> I haven't a clue how to determine if its a 32-bit or 64-bit OS.
>
> Any suggestions?
> Brian Bygland
>
>
How about PROCESSOR_ARCHITECTURE=x86
Re: How to find the 32 & 64 bit OS type in a cmd file
"BrianB" <brian[ at ]notreal.com> 11/12/2008 2:13:08 AM
"Big_Al" <BigAl[ at ]md.com> wrote in message
news:OTBWOeGRJHA.3404[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text]
> BrianB wrote:
>> I'm modifying a cmd script and need to know which type of Windows it's
>> running and if it is 32 or 64 bit. I've found several sites suggesting
>> that the ver command works to find the OS, but the suggestions do not
>> cover all version of XP and Vista. By trial and error I have ...
>>
>> ver | find "2003" > nul
>> if %ERRORLEVEL% == 0 goto ver_2003
>> ver | find "Vista" > nul
>> if %ERRORLEVEL% == 0 goto ver_vista
>> ver | find "Microsoft Windows [Version 6.0" > nul
>> if %ERRORLEVEL% == 0 goto ver_xp
>> ver | find "XP" > nul
>> if %ERRORLEVEL% == 0 goto ver_xp
>> ver | find "Microsoft Windows [Version 5.2" > nul
>> if %ERRORLEVEL% == 0 goto ver_xp
>> ver | find "2000" > nul
>> if %ERRORLEVEL% == 0 goto ver_2000
>> ver | find "NT" > nul
>> if %ERRORLEVEL% == 0 goto ver_nt
>> echo Machine undetermined.
>> goto error
>>
>> But I cannot find any definitive list of what ver returns for each OS.
>> For 64-bit XP the ver output does not include the string "XP".
>>
>> I haven't a clue how to determine if its a 32-bit or 64-bit OS.
>>
>> Any suggestions?
>> Brian Bygland
> How about PROCESSOR_ARCHITECTURE=x86

Thank you. That covers the bit value. Now I just need the OS.


Re: How to find the 32 & 64 bit OS type in a cmd file
"AJR" <ajrjdr[ at ]omcast.net> 11/12/2008 2:34:59 AM
OS build number?
Re: How to find the 32 & 64 bit OS type in a cmd file
Big_Al <BigAl[ at ]md.com> 11/12/2008 2:59:55 AM
BrianB wrote:
[Quoted Text]
> "Big_Al" <BigAl[ at ]md.com> wrote in message
> news:OTBWOeGRJHA.3404[ at ]TK2MSFTNGP05.phx.gbl...
>> BrianB wrote:
>>> I'm modifying a cmd script and need to know which type of Windows it's
>>> running and if it is 32 or 64 bit. I've found several sites suggesting
>>> that the ver command works to find the OS, but the suggestions do not
>>> cover all version of XP and Vista. By trial and error I have ...
>>>
>>> ver | find "2003" > nul
>>> if %ERRORLEVEL% == 0 goto ver_2003
>>> ver | find "Vista" > nul
>>> if %ERRORLEVEL% == 0 goto ver_vista
>>> ver | find "Microsoft Windows [Version 6.0" > nul
>>> if %ERRORLEVEL% == 0 goto ver_xp
>>> ver | find "XP" > nul
>>> if %ERRORLEVEL% == 0 goto ver_xp
>>> ver | find "Microsoft Windows [Version 5.2" > nul
>>> if %ERRORLEVEL% == 0 goto ver_xp
>>> ver | find "2000" > nul
>>> if %ERRORLEVEL% == 0 goto ver_2000
>>> ver | find "NT" > nul
>>> if %ERRORLEVEL% == 0 goto ver_nt
>>> echo Machine undetermined.
>>> goto error
>>>
>>> But I cannot find any definitive list of what ver returns for each OS.
>>> For 64-bit XP the ver output does not include the string "XP".
>>>
>>> I haven't a clue how to determine if its a 32-bit or 64-bit OS.
>>>
>>> Any suggestions?
>>> Brian Bygland
>> How about PROCESSOR_ARCHITECTURE=x86
>
> Thank you. That covers the bit value. Now I just need the OS.
>
>
On a command line just type 'set'
It will return all the variables.
Re: How to find the 32 & 64 bit OS type in a cmd file
"BrianB" <brian[ at ]notreal.com> 11/12/2008 3:38:25 AM
"Big_Al" <BigAl[ at ]md.com> wrote in message
news:eEUR$KHRJHA.4824[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text]
> BrianB wrote:
>> "Big_Al" <BigAl[ at ]md.com> wrote in message
>> news:OTBWOeGRJHA.3404[ at ]TK2MSFTNGP05.phx.gbl...
>>> BrianB wrote:
>>>> I'm modifying a cmd script and need to know which type of Windows it's
>>>> running and if it is 32 or 64 bit. I've found several sites suggesting
>>>> that the ver command works to find the OS, but the suggestions do not
>>>> cover all version of XP and Vista. By trial and error I have ...
>>>>
>>>> ver | find "2003" > nul
>>>> if %ERRORLEVEL% == 0 goto ver_2003
>>>> ver | find "Vista" > nul
>>>> if %ERRORLEVEL% == 0 goto ver_vista
>>>> ver | find "Microsoft Windows [Version 6.0" > nul
>>>> if %ERRORLEVEL% == 0 goto ver_xp
>>>> ver | find "XP" > nul
>>>> if %ERRORLEVEL% == 0 goto ver_xp
>>>> ver | find "Microsoft Windows [Version 5.2" > nul
>>>> if %ERRORLEVEL% == 0 goto ver_xp
>>>> ver | find "2000" > nul
>>>> if %ERRORLEVEL% == 0 goto ver_2000
>>>> ver | find "NT" > nul
>>>> if %ERRORLEVEL% == 0 goto ver_nt
>>>> echo Machine undetermined.
>>>> goto error
>>>>
>>>> But I cannot find any definitive list of what ver returns for each OS.
>>>> For 64-bit XP the ver output does not include the string "XP".
>>>>
>>>> I haven't a clue how to determine if its a 32-bit or 64-bit OS.
>>>>
>>>> Any suggestions?
>>>> Brian Bygland
>>> How about PROCESSOR_ARCHITECTURE=x86
>>
>> Thank you. That covers the bit value. Now I just need the OS.
> On a command line just type 'set'
> It will return all the variables.

None of the variables tell me if its XP or Vista or W2k or ...


Re: How to find the 32 & 64 bit OS type in a cmd file
"BrianB" <brian[ at ]notreal.com> 11/12/2008 3:39:10 AM
"AJR" <ajrjdr[ at ]omcast.net> wrote in message
news:271DA3F4-35E8-4842-8976-70088FD8A8B0[ at ]microsoft.com...
[Quoted Text]
> OS build number?

That's a possibility. Is there a definitive list of build numbers somewhere?


Re: How to find the 32 & 64 bit OS type in a cmd file
"John John (MVP)" <audetweld[ at ]nbnet.nb.ca> 11/12/2008 1:33:36 PM
Use WMI and Win32_OperatingSystem class.

http://www.microsoft.com/technet/scriptcenter/topics/ccs/ccs_predeploy1.mspx

John

BrianB wrote:
[Quoted Text]
> I'm modifying a cmd script and need to know which type of Windows it's
> running and if it is 32 or 64 bit. I've found several sites suggesting that
> the ver command works to find the OS, but the suggestions do not cover all
> version of XP and Vista. By trial and error I have ...
>
> ver | find "2003" > nul
> if %ERRORLEVEL% == 0 goto ver_2003
> ver | find "Vista" > nul
> if %ERRORLEVEL% == 0 goto ver_vista
> ver | find "Microsoft Windows [Version 6.0" > nul
> if %ERRORLEVEL% == 0 goto ver_xp
> ver | find "XP" > nul
> if %ERRORLEVEL% == 0 goto ver_xp
> ver | find "Microsoft Windows [Version 5.2" > nul
> if %ERRORLEVEL% == 0 goto ver_xp
> ver | find "2000" > nul
> if %ERRORLEVEL% == 0 goto ver_2000
> ver | find "NT" > nul
> if %ERRORLEVEL% == 0 goto ver_nt
> echo Machine undetermined.
> goto error
>
> But I cannot find any definitive list of what ver returns for each OS. For
> 64-bit XP the ver output does not include the string "XP".
>
> I haven't a clue how to determine if its a 32-bit or 64-bit OS.
>
> Any suggestions?
> Brian Bygland
>
>

Re: How to find the 32 & 64 bit OS type in a cmd file
"BrianB" <brian[ at ]notreal.com> 11/13/2008 1:45:04 AM
Cool. That gives me what I need to know. One last question. Any suggestion
how to get the information from VBS back to the cmd script?

Brian

"John John (MVP)" <audetweld[ at ]nbnet.nb.ca> wrote in message
news:O5cHmsMRJHA.4916[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text]
> Use WMI and Win32_OperatingSystem class.
>
> http://www.microsoft.com/technet/scriptcenter/topics/ccs/ccs_predeploy1.mspx
>
> John
>
> BrianB wrote:
>> I'm modifying a cmd script and need to know which type of Windows it's
>> running and if it is 32 or 64 bit. I've found several sites suggesting
>> that the ver command works to find the OS, but the suggestions do not
>> cover all version of XP and Vista. By trial and error I have ...
>>
>> ver | find "2003" > nul
>> if %ERRORLEVEL% == 0 goto ver_2003
>> ver | find "Vista" > nul
>> if %ERRORLEVEL% == 0 goto ver_vista
>> ver | find "Microsoft Windows [Version 6.0" > nul
>> if %ERRORLEVEL% == 0 goto ver_xp
>> ver | find "XP" > nul
>> if %ERRORLEVEL% == 0 goto ver_xp
>> ver | find "Microsoft Windows [Version 5.2" > nul
>> if %ERRORLEVEL% == 0 goto ver_xp
>> ver | find "2000" > nul
>> if %ERRORLEVEL% == 0 goto ver_2000
>> ver | find "NT" > nul
>> if %ERRORLEVEL% == 0 goto ver_nt
>> echo Machine undetermined.
>> goto error
>>
>> But I cannot find any definitive list of what ver returns for each OS.
>> For 64-bit XP the ver output does not include the string "XP".
>>
>> I haven't a clue how to determine if its a 32-bit or 64-bit OS.
>>
>> Any suggestions?
>> Brian Bygland
>


Re: How to find the 32 & 64 bit OS type in a cmd file
"John John (MVP)" <audetweld[ at ]nbnet.nb.ca> 11/13/2008 4:06:00 AM
You might want to ask the folks in one of the scripting groups or one of
the script pros reading here might want to offer additional help.

John

BrianB wrote:

[Quoted Text]
> Cool. That gives me what I need to know. One last question. Any suggestion
> how to get the information from VBS back to the cmd script?
>
> Brian
>
> "John John (MVP)" <audetweld[ at ]nbnet.nb.ca> wrote in message
> news:O5cHmsMRJHA.4916[ at ]TK2MSFTNGP06.phx.gbl...
>
>>Use WMI and Win32_OperatingSystem class.
>>
>>http://www.microsoft.com/technet/scriptcenter/topics/ccs/ccs_predeploy1.mspx
>>
>>John
>>
>>BrianB wrote:
>>
>>>I'm modifying a cmd script and need to know which type of Windows it's
>>>running and if it is 32 or 64 bit. I've found several sites suggesting
>>>that the ver command works to find the OS, but the suggestions do not
>>>cover all version of XP and Vista. By trial and error I have ...
>>>
>>>ver | find "2003" > nul
>>>if %ERRORLEVEL% == 0 goto ver_2003
>>>ver | find "Vista" > nul
>>>if %ERRORLEVEL% == 0 goto ver_vista
>>>ver | find "Microsoft Windows [Version 6.0" > nul
>>>if %ERRORLEVEL% == 0 goto ver_xp
>>>ver | find "XP" > nul
>>>if %ERRORLEVEL% == 0 goto ver_xp
>>>ver | find "Microsoft Windows [Version 5.2" > nul
>>>if %ERRORLEVEL% == 0 goto ver_xp
>>>ver | find "2000" > nul
>>>if %ERRORLEVEL% == 0 goto ver_2000
>>>ver | find "NT" > nul
>>>if %ERRORLEVEL% == 0 goto ver_nt
>>>echo Machine undetermined.
>>>goto error
>>>
>>>But I cannot find any definitive list of what ver returns for each OS.
>>>For 64-bit XP the ver output does not include the string "XP".
>>>
>>>I haven't a clue how to determine if its a 32-bit or 64-bit OS.
>>>
>>>Any suggestions?
>>>Brian Bygland
>>
>
>
Re: How to find the 32 & 64 bit OS type in a cmd file
"BrianB" <brian[ at ]notreal.com> 11/13/2008 5:32:15 AM
Thank you. I'll try the scripting.vbscript group.

Brian

"John John (MVP)" <audetweld[ at ]nbnet.nb.ca> wrote in message
news:u$7LhUURJHA.444[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text]
> You might want to ask the folks in one of the scripting groups or one of
> the script pros reading here might want to offer additional help.
>
> John
>
> BrianB wrote:
>
>> Cool. That gives me what I need to know. One last question. Any
>> suggestion how to get the information from VBS back to the cmd script?
>>
>> Brian
>>
>> "John John (MVP)" <audetweld[ at ]nbnet.nb.ca> wrote in message
>> news:O5cHmsMRJHA.4916[ at ]TK2MSFTNGP06.phx.gbl...
>>
>>>Use WMI and Win32_OperatingSystem class.
>>>
>>>http://www.microsoft.com/technet/scriptcenter/topics/ccs/ccs_predeploy1.mspx
>>>
>>>John
>>>
>>>BrianB wrote:
>>>
>>>>I'm modifying a cmd script and need to know which type of Windows it's
>>>>running and if it is 32 or 64 bit. I've found several sites suggesting
>>>>that the ver command works to find the OS, but the suggestions do not
>>>>cover all version of XP and Vista. By trial and error I have ...
>>>>
>>>>ver | find "2003" > nul
>>>>if %ERRORLEVEL% == 0 goto ver_2003
>>>>ver | find "Vista" > nul
>>>>if %ERRORLEVEL% == 0 goto ver_vista
>>>>ver | find "Microsoft Windows [Version 6.0" > nul
>>>>if %ERRORLEVEL% == 0 goto ver_xp
>>>>ver | find "XP" > nul
>>>>if %ERRORLEVEL% == 0 goto ver_xp
>>>>ver | find "Microsoft Windows [Version 5.2" > nul
>>>>if %ERRORLEVEL% == 0 goto ver_xp
>>>>ver | find "2000" > nul
>>>>if %ERRORLEVEL% == 0 goto ver_2000
>>>>ver | find "NT" > nul
>>>>if %ERRORLEVEL% == 0 goto ver_nt
>>>>echo Machine undetermined.
>>>>goto error
>>>>
>>>>But I cannot find any definitive list of what ver returns for each OS.
>>>>For 64-bit XP the ver output does not include the string "XP".
>>>>
>>>>I haven't a clue how to determine if its a 32-bit or 64-bit OS.
>>>>
>>>>Any suggestions?
>>>>Brian Bygland
>>>
>>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen