How to identify if the OS is Vista or higher

D

DPM

Hi,

Is there a way to know if the OS version is Vista or higher through a MS-DOS
batch
file ?

Following is a sample which I managed to do

Ver > OSVer.Txt
FIND "[Version 6." OSVer.Txt > NUL
IF ERRORLEVEL 1 ECHO OS is not Vista
IF NOT ERRORLEVEL 1 ECHO OS is Vista

The problems which I have regarding the above are,
- How to get the output from the VER command to a variable ? or is there any
other command ?
- Say if I send the output from VER to a text file how to know whether the
OS is Vista and above ?
(FIND only searches for a perticular text)

Please advise.
 
D

DPM

Thanks.
Any ideas on how I can do this ? Some sort of clue or example would help.
Do I need to create an exe using a programming language ?


You can always run a simple script
 
P

Peter Foldes

DPM

Since this is a Vista newsgroup and putting a script within a post would not be appropriate for some frequenting this group, may I suggest that you repost this to the scripting newsgroup



--
Peter

Please Reply to Newsgroup for the benefit of others
Requests for assistance by email can not and will not be acknowledged.

DPM said:
Thanks.
Any ideas on how I can do this ? Some sort of clue or example would help.
Do I need to create an exe using a programming language ?


You can always run a simple script

--
Peter

Please Reply to Newsgroup for the benefit of others
Requests for assistance by email can not and will not be acknowledged.

DPM said:
Hi,

Is there a way to know if the OS version is Vista or higher through a
MS-DOS
batch
file ?

Following is a sample which I managed to do

Ver > OSVer.Txt
FIND "[Version 6." OSVer.Txt > NUL
IF ERRORLEVEL 1 ECHO OS is not Vista
IF NOT ERRORLEVEL 1 ECHO OS is Vista

The problems which I have regarding the above are,
- How to get the output from the VER command to a variable ? or is there
any
other command ?
- Say if I send the output from VER to a text file how to know whether the
OS is Vista and above ?
(FIND only searches for a perticular text)

Please advise.
 
D

DPM

Thanks.


DPM

Since this is a Vista newsgroup and putting a script within a post would not
be appropriate for some frequenting this group, may I suggest that you
repost this to the scripting newsgroup



--
Peter

Please Reply to Newsgroup for the benefit of others
Requests for assistance by email can not and will not be acknowledged.

DPM said:
Thanks.
Any ideas on how I can do this ? Some sort of clue or example would help.
Do I need to create an exe using a programming language ?


You can always run a simple script

--
Peter

Please Reply to Newsgroup for the benefit of others
Requests for assistance by email can not and will not be acknowledged.

DPM said:
Hi,

Is there a way to know if the OS version is Vista or higher through a
MS-DOS
batch
file ?

Following is a sample which I managed to do

Ver > OSVer.Txt
FIND "[Version 6." OSVer.Txt > NUL
IF ERRORLEVEL 1 ECHO OS is not Vista
IF NOT ERRORLEVEL 1 ECHO OS is Vista

The problems which I have regarding the above are,
- How to get the output from the VER command to a variable ? or is there
any
other command ?
- Say if I send the output from VER to a text file how to know whether
the
OS is Vista and above ?
(FIND only searches for a perticular text)

Please advise.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top