Environment Variable to determine the OS type (Windows XP, Windows 7)

Posted by Santhosh on Stack Overflow See other posts from Stack Overflow or by Santhosh
Published on 2010-05-07T13:06:57Z Indexed on 2010/05/07 13:08 UTC
Read the original article Hit count: 241

I want to differrntiate between Windows XP and Windows 7 in a XML file. Thought i will use an environment variable for it inside the XML.

However I could not find any system environment variable defined in windows that gives this information.

I see the %OSTYPE% variable but it is only available in Windows 7. It is not defined in XP.

Is there anyway i could do this?

Note that i would like a solution which purely depends on system environment variables. I do not want to create new variables based on executing some command, because i want to use this variable in a XML file.

© Stack Overflow or respective owner

Related posts about windows-7

Related posts about windows-xp