%SystemRoot% is not expanded when I use it in a command.

John Savill

March 4, 1999

1 Min Read
ITPro Today logo in a gray background | ITPro Today

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:

  1. Start the Registry Editor (regedt32.exe)

  2. Move to HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerEnvironment

  3. 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 Editor

  4. Double click on Path and select the contents and press Ctrl-C to copy to the clipboard

  5. While Path is still selected, select Delete from the Edit menu (or click the Del key). Confirm the deletion

  6. Make sure Environment is selected in the left hand pane and select "Add Value" from the Edit menu

  7. Enter a name of Path (note the capital P in path), and type REG_EXPAND_SZ. Click OK

  8. Double click Path and Ctrl-V to copy back in the info you copied into the clipboard. Click OK

  9. 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

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like