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 ]