%SystemRoot% is not expanded when I use it in a command.
March 4, 1999
A. A. If when you type SET or PATH at a command prompt, you notice that the %SystemRoot% environment variable has not been expanded this is a problem and needs to be corrected:
Start the Registry Editor (regedt32.exe)
Move to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerEnvironment
Look at the Path in the right hand pane and check the type (its the second part), e.g.
Path: REG_EXPAND_SZ: %SystemRoot% etc.
If the type is not REG_EXPAND_SZ then perform the next steps, if not exit the Registry EditorDouble click on Path and select the contents and press Ctrl-C to copy to the clipboard
While Path is still selected, select Delete from the Edit menu (or click the Del key). Confirm the deletion
Make sure Environment is selected in the left hand pane and select "Add Value" from the Edit menu
Enter a name of Path (note the capital P in path), and type REG_EXPAND_SZ. Click OK
Double click Path and Ctrl-V to copy back in the info you copied into the clipboard. Click OK
Close the Registry Editor
You can also check HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionSystemRoot and make sure that this REG_SZ value conains the proper path (e:winnt).
About the Author
You May Also Like