Computing.Net > Forums > Programming > Batch Windows Version Check.

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch Windows Version Check.

Reply to Message Icon

Name: Ruisu
Date: April 29, 2009 at 21:23:52 Pacific
OS: Microsoft Windows XP Professional
CPU/Ram: 2.31 GHz / 3070 MB
Product: Gigabyte / Nvdaacpi
Subcategory: Batch
Comment:

Hello.
How could i add a windows version check to
batch.
Eg. It automaticly detects the windows version
and redirects it to the appropriate section of
the batch file.
I was thinking of something along the lines of:
if "%ver%"=="Windows XP" GOTO XP
But of course, ver is not a variable.
Could someone please give me the best
possible way to do this?
Thanks for your help.




Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: April 29, 2009 at 22:35:11 Pacific
Reply:

@echo off & setLocal EnableDelayedExpansion

for /f "tokens=* delims=" %%a in ('ver') do (
set v=%%a
)
echo !v!


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: Ruisu
Date: April 29, 2009 at 22:38:28 Pacific
Reply:

Thanks very much, I can work on it from that. :P


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch Windows Version Check.

About DOS/Windows versions www.computing.net/answers/programming/about-doswindows-versions/381.html

Batch file for checking filesize www.computing.net/answers/programming/batch-file-for-checking-filesize/15432.html

batch file name checking www.computing.net/answers/programming/batch-file-name-checking/9471.html