Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get Windows version from command prompt or from PowerShell

Windows version.

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:

[System.Environment]::OSVersion 
like image 761
Sandie Avatar asked Mar 14 '17 06:03

Sandie


People also ask

How do I check Windows version in CMD?

Winver is a command that displays the version of Windows that is running, the build number and what service packs are installed: Click Start – RUN , type “winver” and press enter.

What version of Windows 10 do I have PowerShell?

How to check the version of PowerShell. To find which version of PowerShell you have installed, start a PowerShell console (or the ISE) and type $PSVersionTable and press ENTER . Look for the PSVersion value.

How get PowerShell version from command line?

In the PowerShell window, type $PSVersionTable. PSVersion and press ENTER to get the exact version of PowerShell.


2 Answers

The ver command shows something like this:

> ver  Microsoft Windows [Versión 10.0.17134.228] 

But in PowerShell (or Git Bash) you have to call it through the cmd command:

> cmd /c ver 
like image 182
Mariano Desanze Avatar answered Sep 28 '22 01:09

Mariano Desanze


The following commands are is going to help you with that. If you need more information, just type in systeminfo:

systeminfo | findstr /B /C:"OS Name" /C:"OS Version"  wmic os get Caption,CSDVersion /value 
like image 22
shameer1101 Avatar answered Sep 28 '22 01:09

shameer1101