I needed to do this in a program recently and came up with the following
function which returns the
version of windows it is running under or -1 when windows is not present.
This is a GFA basic for DOS routine which calls interrupt 2Fh function
1600h. If windows is present the version number is returned encoded into
the AL and AH registers. The interrupt call also returns info on whether
windows is running in real or protected mode but thats another story :-)
FUNCTION is_win
LOCAL max_ver|
~INTR($2f,_AX=$1600)
max_ver|=_AL AND $7f
IF max_ver|>0
RETURN max_ver|*100+_AH
ENDIF
RETURN -1
ENDFUNC
Hope this helps someone out there. Regards Alan GI4MUN