Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to detect if OS is Win 8 or 10
Message
From
26/08/2016 14:19:45
 
 
To
25/08/2016 15:44:41
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2008 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01639890
Message ID:
01640050
Views:
50
Hi Frank,

Works. Can you explain to me what the following means (I don't know what "manifest" means). It may not matter as it seems to work on the PC's I tried it on.

>*!* * For applications that have been manifested for Windows 8.1 or Windows 10.
>*!* Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2).
>*!* To manifest your applications for Windows 8.1 or Windows 10, refer to Targeting your application for Windows.

Thanks,
Albert


>>Hi all,
>>
>>Need to detect if user is running on Win 8 vs. Win 10 vs Win 7. It seems that OS(1) returns "Windows 6.01" for Win 7 and for both Win 8 and Win 10 it returns "Windows 6.02" (for Win 8, I had to get someone else to run but they confirmed they were indeed running Win 8).
>>
>>Other than the build number returned with OS(5), is there any other function or system var that I can check to tell the difference?
>>
>>Thanks,
>>Albert
>
>here's some code using WMI:
>
>
>*!*	Operating system			Version number
>*!*	Windows 10					10.0*
>*!*	Windows Server 2016			10.0*
>*!*	Windows 8.1					6.3*
>*!*	Windows Server 2012 R2		6.3*
>*!*	Windows 8					6.2
>*!*	Windows Server 2012			6.2
>*!*	Windows 7					6.1
>*!*	Windows Server 2008 R2		6.1
>*!*	Windows Server 2008			6.0
>*!*	Windows Vista				6.0
>*!*	Windows Server 2003 R2		5.2
>*!*	Windows Server 2003			5.2
>*!*	Windows XP 64-Bit Edition	5.2
>*!*	Windows XP					5.1
>*!*	Windows 2000				5.0
>*!*	* For applications that have been manifested for Windows 8.1 or Windows 10. 
>*!*	Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2). 
>*!*	To manifest your applications for Windows 8.1 or Windows 10, refer to Targeting your application for Windows.
>
>
>LOCAL WMIService, AllOperatingSystems, OperatingSystem, VersionNumber
>m.VersionNumber = null
>
>m.WMIService = GETOBJECT("winmgmts:\\.\root\cimv2")
>
>m.AllOperatingSystems = m.WMIService.ExecQuery ("Select * from Win32_OperatingSystem")
>FOR EACH m.OperatingSystem in m.AllOperatingSystems
>    m.VersionNumber = m.OperatingSystem.Version
>ENDFOR 
>
>RETURN m.VersionNumber
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform