I wonder if this may related to this defect on Microsoft's Knowledge Base:
http://support.microsoft.com/kb/329308
I've encountered the same problem with environment variables on some XP systems (not only %APPDATA%, like the KB article is about). Using various methods to set the environment variables, including both ones mentioned in the KB article, were of no help... neither was setx (Windows Resource Kit tool).
However, the exact same methods worked on other systems. It is very frustrating - the only solution I've found seems to be using explicit paths rather than environment variable references (which sucks, but works).
Eg,
MYVAR=C:\something
PATH=C:\something\bin
rather than:
MYVAR=C:\something
PATH=%MYVAR%\bin
EDIT: For the past while, I have just been using mklink (http://technet.microsoft.com/en-us/library/cc753194.aspx) to create Junctions (basically symbolic links) rather than mussing around with environment variables and their buggieness. For example, rather than MYVAR as an env var, I just create c:\myvar
- it can point to E:\some\really\long\and\hard\to\remember\let\alone\type\path
or whatever you wish. mklink
is consistent, can be created via the command line, and they persist between reboots. Eg:
mklink /j c:\myvar c:\something
mklink /j c:\myvar E:\some\really\long\and\hard\to\remember\let\alone\type\path
setx
to set the variables instead? That way they will be expanded before entering the registry.