views:

285

answers:

1

I want to differentiate 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.

A: 

No exactly preset environment variables but...

The following is from microsoft and it refers to a program 'gettype.exe', I don't know if this is a built-in or not. I'm not on ms windows to test. Anyway, maybe it helps you.

http://support.microsoft.com/kb/190899

Also, with the 'ver' which looks built-in

Example script using 'ver' http://malektips.com/xp_dos_0025.html

zaf
These samples make use of running utility command or programs to determine the type of the OS. I was wondering if it is possible by just using environment variables?
Santhosh
AFAIK, nope..... If 'ver' is built-in then thats just as good as env var.
zaf
This is the closest answer to my question; So accepting it!
Santhosh