VER

Posted On 2007-04-25 by FortyPoundHead
Keywords: Command Reference
Tags: Windows Commandline Windows
Views: 1599


Display the current operating system version.

Syntax

VER
Use ver to find specific operating systems like this:

@ECHO OFF

:: Win9x checks ::::::::::::

VER |find /i "Windows 95" >NUL
IF NOT ERRORLEVEL 1 GOTO W9598ME

VER |find /i "Windows 98" >NUL
IF NOT ERRORLEVEL 1 GOTO W9598ME

VER |find /i "Windows Millennium" >NUL
IF NOT ERRORLEVEL 1 GOTO W9598ME

:: NT/XP checks ::::::::::::
VER | find "XP" > nul
IF %errorlevel% EQU 0 GOTO s_win_XP

VER | find "2000" > nul
IF %errorlevel% EQU 0 GOTO s_win_2000

VER | find "NT" > nul
IF %errorlevel% EQU 0 GOTO s_win_NT

ECHO Unknown OS !
GOTO :EOF

:: Win9x commands ::::::::::::

:W9598ME
ECHO Win9x commands go here
GOTO :EOF

:W98
ECHO Win98 commands go here
GOTO :EOF

:: NT/XP commands ::::::::::::

:s_win_XP
ECHO XP commands go here
goto :eof

:s_win_2000
ECHO WIN2K commands go here
goto :eof

:s_win_NT
ECHO NT4 commands go here
goto :eof

:EOF (End-of-file)Service Pack Version

This Batch script will give the Service Pack level.
Works for NT, Win2K or WinXP

Bugs

The VER command reports the version of CMD.exe, so if for example you run the Win XP version of CMD under NT 4 then the VER command will return:

Microsoft Windows XP [Version 4.0.1381]

This script was found on usenet some time ago. If you are the author, please come forward so you can be credited.


About the Author

has posted a total of 1974 articles.


Comments On This Post

No comments on this post yet!


Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.


Your IP address is:54.158.30.219

Before you can post, you need to prove you are human. If you log in, this test goes away.


Code Links