Tuesday, March 29, 2011

Operating System Info–Batch File

Here is a simple batch file which you can use to identify the version of Operating System (OS).  I created this blog based on a question posted on the

@echo off
ver | find "6.1" > nul
if %ERRORLEVEL% == 0 goto Win7

ver | find "5.1" > nul
if %ERRORLEVEL% == 0 goto WinXP

goto exit

:Win7
echo Running Windows 7 Script
goto exit

:WinXP
echo Running Windows XP Script
goto exit

:exit

You can also use  systeminfo | find "Windows XP" or systeminfo | find "Windows 7" filter instead of VER command. 

The  Systeminfo /S ComptuerName command can be used to collect system information from a remote machine.  Here is an example to get the Logon Server information from a remote machine:

systeminfo  /s RemoteComputer | find "Logon Server:"

0 comments:

Post a Comment

Popular Posts

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More