reg query "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v CSDVersion
For remote server, you can do this:
reg query "\\10.200.30.4\HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v CSDVersion
And this version just looks more cool:
for /f "tokens=3*" %x in ('reg query "\\10.200.30.4\HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v CSDVersion') do @echo %x %yService Pack 2