Digg It! Slashdot It! Delicious It!
How to determine the Windows OS Version in a .bat or .cmd Batch File Script
WindowsVersion.bat
@echo off @echo Checking your OS Version... @echo. ver | find "Windows 98" >nul if not errorlevel 1 goto win98 ver | find "Windows NT" >nul if not errorlevel 1 goto winnt ver | find "Windows 2000" >nul if not errorlevel 1 goto win2k ver | find "Windows XP" >nul if not errorlevel 1 goto winxp ver | find "Version 5.2" >nul if not errorlevel 1 goto win2003 :win98 @Echo. @Echo This is Windows 98 goto exit :winnt @Echo. @Echo This is Windows NT goto exit :win2k @Echo. @Echo This is Windows 2000 goto exit :winxp @Echo. @Echo This is Windows xp goto exit :win2003 @Echo. @Echo This is Windows Windows 2003 goto exit :exit echo. pause