While I don't have XP to play with, I do believe that %OS% = Windows_NT on all three vesions, NT, 2K, and XP. The DOS VER command however should give you better granularity. For exanple, to identify W2K, this does the trick.

ver | find /c "5.00"

Doesn't XP return "5.1" or something like that?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.