Windows has command line utilities that show us the version of the Windows OS we are using including the service pack number.
If you just want to find the OS name, you can use ver command. Just open command window and execute ver command. But note that this does not show service pack version.
C:\>ver
Microsoft Windows XP [Version 5.1.2600]
C:\>
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
Example:
C:\>systeminfo | findstr /B /C:"OS Name" /C:"OS Version" Microsoft Windows XP Professional OS Version: 5.1.2600 Service Pack 2 Build 2600
This command works on XP, Vista and Windows 7 and on Server editions also. Find below example for Win7.
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" OS Name: Microsoft Windows 7 Ultimate OS Version: 6.1.7600 N/A Build 7600
If you want to print more details, then you can use just ‘OS’ in the findstr search pattern. See example below for Server 2008.
C:\>systeminfo | findstr /C:"OS" OS Name: Microsoft Windows Server 2008 R2 Enterprise OS Version: 6.1.7600 N/A Build 7600 OS Manufacturer: Microsoft Corporation OS Configuration: Standalone Server OS Build Type: Multiprocessor Free BIOS Version: IBM -[BWE117AUS-1.05]-, 7/28/2005
Using WMI:
The below wmi command gives the OS and the service pack version.
wmic os get Caption,CSDVersion /value
Also Read:
Windows CMD commands reference
{ 28 comments… read them below or add one }
How to find windows edition ?
Execute 'Winver' from command prompt or from Run window. It will show you the windows version.
The "systeminfo" command gives the edition info under the headings "OS Name:" and "OS Version:" as well as a lot of other information all in the console. You can parse it with "findstr" if you need only the edition info:
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
I was looking for this…I had to write a script which runs on different windows editions and I need to capture the os name..this post helped me..thank you..
Very helpful if I want to do a remote command without GUI. Thanks a ton!
Thanks for the comments. Glad that this post helped you..
Thanks friend for the tip..I need to find os version from windows dos and this has helped me..
Thank you a lot!
I realy needed this tip.
Thanks much! for sharing the info!
–Sannidhi–
How can I script this for multiple servers and save the output in csv format?
Run the below command on each of the servers.
On my xp system it prints the following data.
You can use psexec.exe or rsh tool to run this command remotely on the servers.
How to find the bit size?
systeminfo | findstr /C:"System type" would give you the processor architecture. From this you can derive if it's 32 or 64 bit. You can also use wmic cpu command to get processor info.
How to get the OS name and version for a list of servers ?
Run the command mentioned in the post on each of the servers using psexec or rsh. I will soon add a post on psexec.
The above can be used to retrieve information from a remote computer
Thank you for posting.
I need to find the image version of a windows 7 installation. What command do I use to find out?
If I have understood correctly, you have different images of Win7 and you want to find out which image you have installed on the computer? AFAIK, windows can’t do that.
I can think of a workaround for this. You can add custom reg key and set the image version number in that and then create the image. And on the installed computer, you can do reg query from command line.
The quotes are incorrect ASCII characters (MS Office quotes).
Use this version instead:
I’ve fixed the issue in the post. Copy pasting the command would work fine now. Thank you for pointing that out.
Very helpful, Thanks admin.
No support for systeminfo within xp home
You can use registry keys in that case. check this out.
Windows version in registry key
Thanks thats really useful, handy when your talking to customers and trying to get that info. also useful when you are providing remote assistance, and need to know. I took what you had, and added a few lines, incase anyone will find it useful:
<>
echo ****************************************
echo YOUR PC’S MAKE AND MODEL
echo ****************************************
echo.
wmic computersystem get manufacturer
wmic csproduct get Name
wmic os get caption
wmic computersystem get systemtype
wmic bios get serialnumber
echo.
echo ****************************************
echo.
ECHO TAKE NOTE OF THE ABOVE INFO.
Echo.
Pause
<>
When Run, this displays the following info:
****************************************
MY PC’S MAKE AND MODEL
****************************************
Manufacturer
SAMSUNG ELECTRONICS CO., LTD.
Name
300E4C/300E5C/300E7C
Caption
Microsoft Windows 7 Professional
SystemType
x64-based PC
SerialNumber
HY8E91QC800275
****************************************
TAKE NOTE OF THE ABOVE INFO.
Press any key to continue . . .
HOPE THIS IS USEFUL FOR PEOPLE.
How can I get the serial number from a Windows Server 2000 device. wmic bios get serialnumber does not work on this windows version. PLEASE HELP
anybody know how can do that but in vbscript or .vbs file
strComputer = “localhost”
Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}!\\” _
& strComputer & “\root\cimv2″)
Set colOSes = objWMIService.ExecQuery(“Select * from Win32_OperatingSystem”)
For Each objOS in colOSes
Wscript.Echo “Version: ” & objOS.Version ‘Version & build
Wscript.Echo “OS Type: ” & objOS.OSType
Next