From LedHed's Wiki
Get OS version and Service Pack level of local machine:
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
Get OS Version and Service Pack level of remote machine:
systeminfo /s \\<REMOTE-HOSTNAME> | findstr /B /C:"OS Name" /C:"OS Version"
Where <REMOTE-HOSTNAME> is the name of the remote computer.
Reference
systeminfo | findstr /B /C:"OS Name" /C:"OS Version"