Depending on what you are looking for the SYSTEMINFO command can be a great source of information as well. Run the command from a prompt to get a sense for the information available. In a batch file, here are a couple of commands to extract the OS Name and OS Version.
for /f "tokens=1-2*" %%A in ('systeminfo 2^>NUL ^|find "OS Name:"') do set osname=%%C
for /f "tokens=1-2*" %%A in ('systeminfo 2^>NUL ^|find "OS Version:"') do set osver=%%C
echo %osname%
echo %osver%
~bp