FoxPro Programming
How to get the current Windows version?
I want to know the current Windows version running the application.
Using the native function, OS() did not produce the desired results.
Would there be a better way?

This is one solution:
LOCAL WMIService, MySytem, AllSystems
m.WMIService = GETOBJECT("winmgmts:\\.\root\cimv2")
m.AllSystems = m.WMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem",,48)
FOR EACH m.MySytem IN m.AllSystems
? "Caption:", m.MySytem.Caption
? "Version:", m.MySytem.Version
? "BuildNumber:", m.MySytem.BuildNumber
ENDFOR