13

Is there is a way to get service pack number from command line? Or the build number from command line (from which I can tell the service pack number (see How do I determine Windows Version and Service Pack from WindowsUpdateLog.txt))?

Upon starting cmd, part of the Windows version number is shown on the screen, but not the service pack number.

I prefer a non-PowerShell answer, but I wouldn't mind knowing about a PowerShell answer anyways since some computers I deal with do have it installed.

5 Answers5

15

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

Source: Find windows version from command prompt

wasif
  • 9,176
Giri
  • 559
10

You can get it using WMIC - wmic os get servicepackmajorversion

For more on using WMIC, see this little tutorial: http://quux.wiki.zoho.com/WMIC-Snippets.html

wasif
  • 9,176
6

You can type in CMD:

Winver

r0ca
  • 5,833
2

You can get it from the command line by querying the registry for the ServicePack key. If an SP is installed, it will be shown, otherwise, it will say that it was unable to locate the specified key, in which case there is no service pack.

reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v ServicePack
nhinkle
  • 37,661
0

You can use this:

wmic os get csdversion /format:value
wasif
  • 9,176