Batch Windows Version Check.

Gigabyte / Nvdaacpi
April 29, 2009 at 21:23:52
Specs: Microsoft Windows XP Professional, 2.31 GHz / 3070 MB
How could i add a windows version check to
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.

See More: Batch Windows Version Check.

Report •

April 29, 2009 at 22:35:11
@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.


Report •

April 29, 2009 at 22:38:28
Thanks very much, I can work on it from that. :P

Report •

Related Solutions

Ask Question