Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 12 down vote accepted
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" 


share|improve this answer
This is the only one that works on all computers I've tried these methods on. – Alexander Bird Oct 8 '10 at 19:20
ps - the above only works if the user language is English, since the string filter uses the English names. Using systeminfo on its own will work for any language - though requires manual effort searching through all the data returned. – JohnLBevan Oct 3 '12 at 13:59

You can get it using WMIC - wmic os get servicepackmajorversion

For more on using WMIC, see this little tutorial:

share|improve this answer
Is wmic installed on all Windows computers? for some reason, my home computer does not recognize wmic. – Alexander Bird Oct 1 '10 at 16:51
Awesome tool, thanks for sharing! @Thr4wn, according to Wikipedia, WMIC is not available on Windows XP Home Edition, but is available on XP Pro and all later versions of Windows. – nhinkle Oct 1 '10 at 20:18

You can type in CMD:


share|improve this answer
nice answer! .... +1 when i get more votes – studiohack Sep 30 '10 at 20:49
Hm... problem with that is, it opens a GUI tool, which may not be what the user is attempting to do. – nhinkle Sep 30 '10 at 21:05
SYSTEMINFO run in a command prompt will display without GUI. – r0ca Sep 30 '10 at 21:16
In cmd.exe you can use just ver and get the version on stdout. But you need to convert the build number to get the SP. – Richard Oct 1 '10 at 8:26
ver doesn't give the full version number. It stops right before the service pack number. – Alexander Bird Oct 1 '10 at 16:49

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
share|improve this answer
This only works if there is a Service Pack installed (e.g. currently Windows 7 does not have a Service Pack so the key does not exist) – misterjaytee Oct 1 '10 at 11:14
I know; that's what I stated in my answer. If the key doesn't exist, then there is no service pack, thus it is SP0. If the key does exist, it'll tell you the service pack. So either way, you can figure out what service pack (if any) is installed. – nhinkle Oct 1 '10 at 20:17
When I try Giri's solution, it shows SP 3, but this method reports that it was unable to find the specified registry key or value (I copied/pasted the command into cmd). – Alexander Bird Oct 8 '10 at 19:19
Instead of "ServicePack", you can use "ProductName" and "CSDVersion" – d.moncada Sep 25 '15 at 15:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.