MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
August
Sun Mon Tue Wed Thu Fri Sat
  1
     
2016
Months
Aug


Mon, Aug 01, 2016 11:08 pm

Determining the version of Microsoft Windows from the command line

You can determine the version of Microsoft Windows on a system from a command line interface (CLI), e.g., a command prompt, using the systeminfo command. Since that command will provide a lot of other information on the system, you can filter the output to see only the operating system (OS) version by piping its output into the findstr command using the "|" pipe character. The command below will show only the operating system version:
C:\>systeminfo | findstr /R "^OS.Version"
OS Version:                10.0.10586 N/A Build 10586

C:\>

The /R option indicates that the findstr command should perform its search based on a regular expression. The "^" character is a character that when included in a regular expression means that what follows should be at the beginning of the line. Without it, you could see something like the following, instead, since "BIOS Version also matches:

C:\>systeminfo | findstr /R "OS.Version"
systeminfo | findstr /R "OS.Version"
OS Version:                10.0.10586 N/A Build 10586
BIOS Version:              Dell Inc. A04, 11/21/2011

C:\>

The period between "OS" and "Version" indicates in a regular expression that any one character in that space will match; in this case there is a space character between the two words, which will match the period in a regular expression. If you want to have a period treated as a period rather than serving its function as a regular expression character, you can "escape" its meaning by using the backslash, i.e. "\", escape character.

[ More Info ]

[/network/email/sendmail] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo