≡ Menu

2 Ways to Find Windows Version from command line

Windows has command line utilities that show us the version of the Windows OS running on the computer, including the service pack number. There are multiple CMD commands that help with finding this, you can pick the one that suits your need. Ver command can show you the OS version whereas Systeminfo command can additionally show service pack number, OS edition and build number etc.

Find Windows Version from CMD

We can find Windows version, OS edition and service pack number using Systeminfo command. This command prints lot of other information too, which we can filter out using findstr command.

systeminfo | findstr /B /C:"OS Name" /C:"OS Version"


C:\>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft Windows 7 Ultimate
OS Version:                6.1.7600 N/A Build 7600

In case of Windows 7 SP1, the output would be slightly different as below.

c:\>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft Windows 7 Enterprise
OS Version:                6.1.7601 Service Pack 1 Build 7601

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

Find version using WMI

Run the below WMIC command to get OS version and the service pack number.

wmic os get Caption,CSDVersion /value

Example on Windows 7:

c:\>wmic os get Caption,CSDVersion /value
Caption=Microsoft Windows 7 Enterprise
CSDVersion=Service Pack 1

Check Windows version from Run

  1. Open Run dialog from Start menu/Use the keyboard shortcut [Windows + R]
  2. Execute command ‘winver’

Find Windows version from Run

Finding version using ver command

In older versions of Windows, ver command was showing the Windows version on cmd.

Microsoft Windows XP [Version 5.1.2600]

However, this command does not show version on a Windows 7 system.

Finding version on Windows 7 system

Also Read:

A-Z list of CMD commands


31 comments… add one
  • Suchitra

    How to find windows edition ?

    • pradip

      type systeminfo in cmd

  • Techblogger

    Execute 'Winver' from command prompt or from Run window. It will show you the windows version.

  • Anonymous

    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..

  • Anonymous

    Very helpful if I want to do a remote command without GUI. Thanks a ton!

  • Amit

    Thanks friend for the tip..I need to find os version from windows dos and this has helped me..

  • Raj

    How can I script this for multiple servers and save the output in csv format?

  • Techblogger

    Run the below command on each of the servers.

    wmic os get buildnumber,caption,CSDVersion /format:csv 

    On my xp system it prints the following data.

    techblogger-pc,2600,Microsoft Windows XP Professional,Service Pack 2

    You can use psexec.exe or rsh tool to run this command remotely on the servers.

  • Anonymous

    How to find the bit size?

    • *Santhosh*

      you can this command
      c:/>wmic os get osarchitecture

  • Techblogger

    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.

  • Anonymous

    How to get the OS name and version for a list of servers ?

  • Techblogger

    Run the command mentioned in the post on each of the servers using psexec or rsh. I will soon add a post on psexec.

  • Anonymous
    WMIC /node:RemoteComputerName os get buildnumber,caption,CSDVersion /format:csv 

    The above can be used to retrieve information from a remote computer

  • fred

    No support for systeminfo within xp home

  • Kelly

    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

  • J0545

    anybody know how can do that but in vbscript or .vbs file

  • London

    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

  • Vikas Thakor

    just type “winver” command in run and
    you will get windows version information on GUI.

  • sadakar

    Nice post… thank you..
    Checked when installing mango db ..

    wmic command is not working …. any idea on the same ? What could be the probable solution to make work of wmic command ?

  • radhika

    checked a few sites.. but found the exact answer..thx..

  • shailesh

    i want to know the o.s. details of remote computer through command prompt or program….

  • Sharath

    Thank you very much.

    This was exactly the info I was looking for.
    Rest of the ‘Comments’ were also very informative. Thank you all you guys.


  • Anu

    Thank You so much. I am using windows 7 but the systeminfo cmd isn’t work. when i typed, it displays “systeminfo” is not recognized as internal & external cmd. How to solve this problem??

    • yogesh

      Hi anu,
      check spelling once it will work correctly. in any version of windows. or simply try this command to take your version detail on notepad file “systeminfo >> notepad.txt”
      hope it will help you :)

  • NicT

    6 years from original post and still useful for another person. Thanks very much.

  • Krzysiu

    Hey! Please, use the first way only to yourself. The first way is slow, but most importantly – it won’t work for other locales than EN. For other locales it will get either blank result or incorrect result. This post is old, these were different times. As a coder, I’d say that nowadays second way is safe to use. There’s no point in keeping compatibility for OS made 15 years ago (XP).

  • Asim Khan

    Very helpful forum wmic did the work for me

  • Phoouwa Seelavong

    Hi Guys I have a big problem, when I installed new window on my notebook PC . The command shows me
    Microsoft Windows version 6.1.7601
    X:\windows \system 32>

    How can I do about this? Help me please.

  • Daniel Plácido

    How do I create a variable with the result of the command?

Leave a Comment