Based on this post for changing the output color of command prompt text in Windows 10, I'm looking for the best way to detect the OS version in a batch file IF statement.
How to echo with different colors in the Windows command line
From my understanding, colorized text was added in Windows 10 Threshold 2 November 18, 2015 (10.0.10586.11)
In Windows 10 version history, up until the Version 1607 (Anniversary Update), there was a major.minor.build.revision numbering scheme so I want the detection to be very granular.
https://en.wikipedia.org/wiki/Windows_10_version_history
I found this post which compares major.minor.build to a user input, but can't wrap my head around what it's doing for my needs.
So based on that information, I'm trying to compare the detected version of windows to 10.0.10586.11 in a batch file.
If its greater than or equal to that version, colorize the text, if not use standard formatting.
This was my first attempt to colorize text in an IF statement. Although this appeared to work in Windows 10, it didn't work in Windows 8.1 because string "10." is less than "6.3"
FOR /F "tokens=4-5 delims=. " %%i in ('ver') DO SET Version=%%i.%%j
IF "%Version%" GEQ "10.0" (echo [92mHere is my text in green.[0m) ELSE (echo Here is my text)
Note the required escape characters are missing in the above sample