Shell out to: systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
All you'll need to do is pipe the info there to clipboard, or to a file, and then read it in. (change quotes to CHR$(34) characters for the SHELL statement to avoid issues.)
Results look like this (for Win 10):
systeminfo | findstr /B /C:"OS Name" /C:"OS Version" <-- the command
OS Name: Microsoft Windows 10 Pro <-- it's output
OS Version: 10.0.18363 N/A Build 18363 <-- on two lines... other OS versions may have more lines of information for you.
You can also just stick to the simple old VER command...
SHELL "ver>temp.txt"
OPEN "temp.txt" FOR INPUT AS #1
LINE INPUT #1, blank$ 'output is a blank line
LINE INPUT #1, ver$ 'and then the version, for some odd reason
PRINT ver$
CLOSE
KILL "temp.txt"