if you want a little more detail:
for /f "tokens=2 delims=," %%i in ('wmic os get caption^,version /format:csv') do set os=%%i echo Hello, I am %os%
or just fit your requirements:
for /f "tokens=2 delims=," %%i in ('wmic os get caption^,version /format:csv') do set os=%%i echo %os%|find " 10 ">nul &&echo Hello I'm Windows 10||echo I am another os
( ,version ensures that your desired string is not the last token that contains this ugly wmic string)
source share