Question

What is an easy (to implement) way to check whether I am on Windows Vista or Windows Server 2008 from a Python script?

platform.uname() gives the same result for both versions.

Was it helpful?

Solution

As mentioned in the other question the foolproof (I think) way is to use win32api.GetVersionEx(1). The combination of the version number and the product type will give you the current windows platform you're running on. Eg. the combination of version number "6.*" and product type VER_NT_SERVER is Windows Server 2008.

You can find information about the different combinations you can get at msdn

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top