Archive: refreshenv.exe trouble w/xp


refreshenv.exe trouble w/xp
refreshenv.exe doesn't appear to work properly with windows xp - but it's likely i'm doing something wrong.

if i simply WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" Path "%systemroot;%systemroot%\system32;%systemroot\system32\wbem" and then ExecWait RefreshEnv.exe, when i exit the installer the path is 'set' but not actually active. if i pull up a command window it will tell me that the path is set, but when i attempt to access commands from the system32 directory (like net.exe) it cannot find them. if i right-click my computer and select properties, it cannot find framedyn.dll from the system32\wbem directory. if i run RefreshEnv.exe manually outside of the installer, it makes no difference.

however, if i open up the path from the system control panel and change it in any way - like adding a semicolon to the end - when i exit the window it 'takes' system-wide and everything works properly. is it possible that RefreshEnv.exe doesn't work under windows xp?


solved! i determined it was %systemroot% resolution that was screwing me, and subsequently found that the system path (hklm system currentcontrolset control sessionmanager environment path) won't resolve it unless it's a reg_expand_sz - i was using writeregstr, which does reg_sz by default.