Security Basics mailing list archives

RE: SP level of the Win OS from CMD


From: honswlos+sec () gmail com
Date: Fri, 14 Sep 2007 16:07:19 -0700

The registry value HKLM\SOFTWARE\Microsoft\Windows NT\Current
Version\CSDVersion contains the name of the latest service pack (if
any) installed on the machine.

To do this on the command line, use the REG command:

reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v CSDVersion

The quotes are necessary, because "Windows NT" contains a space.

You can also use the find utility to get only the line with the
information back:

 reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v
CSDVersion | find "CSDVersion"

This will return only the line: "CSDVersion   REG_SZ   Service Pack 2"

-Matt


Current thread: