- Find windows OS version from command line
- Find OS Version and Service Pack number from CMD
- Check Windows version using WMIC command
- How to get Windows version from command prompt or from PowerShell
- 6 Answers 6
- What version of Windows do I have?
- Checking your Windows version using a keyboard shortcut
- How to Find Your Windows 10 Build Number, Version, Edition and Bitness
- Find Windows 10 Build Number, Version, Edition and Bitness
- System Settings App
- System – Control Panel
- Using the DirectX Diagnostic Tool
- Using WMIC (WMI command-line tool)
- System Information Utility
- About Windows (WinVer)
- Watermark on the Desktop
- Using SystemInfo.exe Command-line tool
- Windows 10 Build/Version Upgrade History
- Windows command get windows version
- Вопрос
- Ответы
- Все ответы
Find windows OS 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 give you service pack, OS edition and build number etc.
Find OS Version and Service Pack number from CMD
As you can see above, ver command shows only OS version but not the service pack number. We can find service pack number as well with Systeminfo command. Systeminfo dumps lot of other information too, which we can filter out using findstr command.
This command works on XP, Vista and Windows 7 and on Server editions also. Find below example for Win7.
In case of Windows 7 SP1, the output would be slightly different as below.
If you want to print more details, then you can use just ‘OS’ in the findstr search pattern. See example below for Server 2008.
Check Windows version using WMIC command
Run the below WMIC command to get OS version and the service pack number.
Example on Windows 7:
If you want to find just the OS version, you can use ver command. Open command window and execute ver command. But note that this does not show service pack version.
This command does not show version on a Windows 7 system.
How to get Windows version from command prompt or from PowerShell
But is there a way to get the exact version string using command line output similar to the one mentioned in the image?
The attached is the output of «winver» command from run. PS: I am looking for a batch or PowerShell command.
There are some alternates available to get the Windows version like this PowerShell command:
6 Answers 6
The following commands are is going to help you with that. If you need more information, just type in systeminfo:
The ver command shows something like this:
But in PowerShell (or Git Bash) you have to call it through the cmd command:
I found it somewhere, PowerShell:
To add to @Bonifacio ‘s answer:
Would be even better, because it returns only the ReleaseId value, which you could then pipe to a file. Especially useful if you have several hosts to deal with.
With system information you can only get the build with that value and go to Google to get the respective version.
However, one simple way is by searching the registry on the command line:
The reg query way suggested all output a little garbage.
Using a for loop with tokens will output clean information.
The tokens=3 refers to the third word from the original output.
You will need to double the % if running inside a bat file.
You can set the output as a variable by replacing echo %i with set build=%i
Also remember to escape ^ any special characters.
Lastly look at HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion for the string that has the required value. You may need to adjust the token count.
What version of Windows do I have?
As a Windows user, it’s important to know which operating system version you are using. You need this information when installing new programs and also for troubleshooting.
Microsoft provides details about the Windows version installed on your computer in several places in the operating system, e.g. in the Control Panel. There are three different ways of accessing the relevant system information. Let’s take a look at them now.
Checking your Windows version using a keyboard shortcut
The quickest way to find out your Windows version is using a keyboard shortcut. On newer systems, the steps are as follows:
- Simultaneously press the [Windows] key and the [Pause] key.
- A system information window will appear.
Under the heading “View basic information about your computer”, you will see the name of your operating system, e.g. Windows 10 Enterprise.
The window also contains an overview of the technical characteristics of your system, for example: processor architecture, installed memory (RAM) and system type (i.e. 32-bit or 64-bit). The next section shows the name of your computer and network domain settings. You can also see whether or not your Windows version is activated.
The system information window therefore contains all the information you need in order to install new programs.
However, it does not give you detailed information about your Windows version, such as the version number or the OS build number. You need this information if you want to check whether your operating system has all of the latest updates for example.
The [Windows] key + [Pause] key shortcut does not work on older Windows systems.
How to Find Your Windows 10 Build Number, Version, Edition and Bitness
The Build Number, Version, “Bit”ness (32-bit or 64-bit) of your Windows installation can be determined using many ways, and here are some of the methods listed. Screenshots are from a Windows 10 PC, but most of the information applies to all versions of Windows.
Find Windows 10 Build Number, Version, Edition and Bitness
System Settings App
In Windows 10, use the System Settings app to find the OS information. Click Start, type About your PC. Click About your PC from the results.
System – Control Panel
Press Winkey + Pause-break keys. This opens the Control Panel → All Control Panel Items → System. Alternately, you can run sysdm.cpl directly.
Note: Since the Windows 10 v20H2 update, the following interface is hidden. Pressing the Winkey + Pause-break would take you to the modern Settings page instead. Microsoft is gradually porting items from the classic Control Panel to the Settings user interface. However, you can access the classic System panel by running this shell command from the Run dialog.
Using the DirectX Diagnostic Tool
Using WMIC (WMI command-line tool)
Open a Command Prompt window and type:
The WMIC command-line (mentioning “OSArchitecture”) tells you the bitness of your Windows. You can get as many details as you need using WMIC OS Get command, such as:
Note: Here is a complete list of fields you can retrieve using WMIC OS Get (which uses the Win32_OperatingSystem class)
In addition to all of the above methods, you can check the Help → About page any Windows desktop application like Notepad, Wordpad, Internet Explorer or others, for the Windows version & build information.
Note: The following methods don’t tell you whether you have an x64 version of Windows installed or not. They only show the OS installed and the System or Processor type (x86 or x64). System Type x64 means the processor is 64-bit. But that does not necessarily mean you have Windows x64. It could be Windows x86 OS running on an x64 CPU based machine.
System Information Utility
The System Information utility (MSInfo32.exe) has the details you need.
Scroll down and check the Hardware Abstraction Layer field. It also shows the full build number, including the minor build number.
About Windows (WinVer)
Alternately, in Command Prompt, run the ver.exe command to know the OS build number.
Watermark on the Desktop
If you’ve added the PaintDesktopVersion or the DisplayVersion registry values as in article Display Build Info, Version and WinDir Path in the Desktop, you’ll see the Windows Edition, Build Information and WinDir path in the desktop shown as a watermark. For evaluation versions of Windows, the watermark displays by default.
Using SystemInfo.exe Command-line tool
Open a Command Prompt window and type in:
The SystemInfo command outputs more information than you need. To get the OS Name and OS Version fields from the output, type this in the Command Prompt window:
The findstr command will parse the output and display only the two lines (OS name and version.)
Windows 10 Build/Version Upgrade History
Did you know that Windows 10 keeps track of your every build/feature upgrade in the registry? Redditor u/sizzlr has found an interesting registry location and wrote a PowerShell script to unscramble the Windows 10 build installation dates from the registry.
Every time you install a feature update, Windows 10 creates a new subkey named “Source OS (Updated on )” and a bunch of values in the right pane. The registry key is located at:
Additionally, there are two values, namely InstallTime and InstallDate, which store the install date and time. The following PowerShell script gathers all the details for you and presents in a table:
Do you know any other methods to find the Windows build, OS version and bitness? Let’s know in the Comments section below.
Windows command get windows version
Вопрос
I am running SCOM 2012 R2 UR13. Is there a way I can get a report from SCOM or a Powershell script to get the Windows 10 version on my clients? I am trying to see how many clients have version 1709?
Ответы
you can easily do this with PowerShell:
If you need more details on each of the entries, you can add «select *» like this:
Hope I could help. Regards,
Stoyan (Please take a moment to «Vote as Helpful» and/or «Mark as Answer» where applicable. This helps the community, keeps the forums tidy, and recognizes useful contributions. Thanks!) Blog: https://blog.pohn.ch/ Twitter: @StoyanChalakov
- Предложено в качестве ответа Sameer Mhaisekar 4 февраля 2018 г. 4:48
- Помечено в качестве ответа Stoyan Chalakov MVP 21 января 2020 г. 12:24
You can find it using PS script as Stoyan & Roger mentioned or from Windows OS state view in scom or using below query on OperationsManager DB:
(Please «Mark as Answer/Vote as Helpful» if applicable)
« I tried both scripts. The first one displays little information. the second script displays more information, but not the OS version: «
All the entries you got returned are your Windows 10 Clients.
This is the case, because you are getting the instances of the class
so all matches are instaces of this class.
On the second try, when reading more carefully I noticed you are looking only for the «1709» Builds.
You can do the following:
Option #1
— Got to the «Monitoring» opane
— Navigate to the «Operations Manager» folder
— Navigate to «Agent Details»
— Select the state view «Agents by Version»
— Search for «1709». 🙂
Option #2
or you can leverage this great MP, which also reports on the OSVersion:
Great added value, recommend it.
Option #3
You can try with the SQL Query, provided by SystemCenter User above. Hope that helps. Regards,
Stoyan (Please take a moment to «Vote as Helpful» and/or «Mark as Answer» where applicable. This helps the community, keeps the forums tidy, and recognizes useful contributions. Thanks!) Blog: https://blog.pohn.ch/ Twitter: @StoyanChalakov
- Изменено Stoyan Chalakov MVP 6 февраля 2018 г. 14:39
- Предложено в качестве ответа GouravIN 7 февраля 2018 г. 3:41
- Помечено в качестве ответа Stoyan Chalakov MVP 21 января 2020 г. 12:24
Все ответы
you can easily do this with PowerShell:
If you need more details on each of the entries, you can add «select *» like this:
Hope I could help. Regards,
Stoyan (Please take a moment to «Vote as Helpful» and/or «Mark as Answer» where applicable. This helps the community, keeps the forums tidy, and recognizes useful contributions. Thanks!) Blog: https://blog.pohn.ch/ Twitter: @StoyanChalakov
- Предложено в качестве ответа Sameer Mhaisekar 4 февраля 2018 г. 4:48
- Помечено в качестве ответа Stoyan Chalakov MVP 21 января 2020 г. 12:24
I tried both commands, and neither one tells me which version of Windows 10 is installed. Thank you for your help.
If in your deployment these properties are not populated with the version like «1709», you will have to write your own discovery.
Please use this powershell cmdlet
get-scomclass | where-object <$_.Name -eq ‘Microsoft.Windows.Client.Win10.OperatingSystem’>| get-SCOMclassInstance | Select *
Please find the below tab in reporting section and give the server name in group after opening this you will get all the information even when the OS has installed. Really worth!
Cheers, Gourav (Please do take a moment to «Vote as Helpful» and/or «Mark as Answer» wherever applicable. Thanks!) or find my Facebook and LinkedIn link in profile.
You can find it using PS script as Stoyan & Roger mentioned or from Windows OS state view in scom or using below query on OperationsManager DB:
(Please «Mark as Answer/Vote as Helpful» if applicable)
I tried both scripts. The first one displays little information. the second script displays more information, but not the OS version: