HOMEPATH variable has disappeared

Hello,

 

Due to a hard drive crash I was forced to do a clean reinstall of WIndows XP Professional and all my software.  All went well for a while but recently the HOMEPATH environment variable is simply missing and I have been unable to correct the problem.  I imagine this will confuse some applications.

 

I don't see any other missing variables; HOMEDRIVE for example is fine.

 

I tried simply adding the variable under Control Panel->System->Advanced->Environment Variables, but it stopped taking effect after the next reboot.

 

In the registry under My Computer\HKEY_CURRENT_USER\Volatile Environment, HOMEPATH is a blank string.  When I set it, it doesn't fix the problem and goes back to blank next reboot.  In the registry under My Computer\HKEY_USERS\{...}\Volatile Environment, it acts the same way.

 

Is there any way to restore this environment variable?

 

Peter

 

I have a feeling you’re confusing Shortcut variables with the Environment variables.

 

1. The registry key HKEY_CURRENT_USER\Volatile Environment shows (in the right pane) all the shortcuts, e.g. if you type %appdata% into a Run window (Windows Logo key+R), the folder C:\Documents and Settings\[Your User Name]\Application Data will open.

 

2. The Environment Variables (System > Advanced Tab > Environment Variables) should match those shown in registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment.

 

A full list of all the variables can be displayed by opening a Run window (Windows Logo key+R), typing cmd /k set (note the two spaces) and press Enter.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I guess I was unclear, so I'll start at the beginning...

 

There is an environment variable called HOMEPATH that is one of several "standard" environment variables set up by Windows.  Many applications expect it to be valid.  Others like it include APPDATA, HOMEDRIVE, and so on. It does not normally appear under the "Environment Variables" tab under System->Advanced because Windows sets it up from some other source at startup.

 

In my system, for some reason I don't understand, it has disappeared.  When I list all environment variables in a command shell it simply isn't there.  Something happened while I was recovering my system that caused this to happen.  It is a real problem and I have been trying to find a solution:

 

Adding HOMEPATH under the "Environment Variables" tab works temporarily, but the variable disappears again after a reboot.  It is still in the list of variables on the tab, but it does not take effect after a reboot.  No solution there... Windows is overriding that setting.

 

Trying to discover from where Windows sets the value of HOMEPATH, I scanned the registry.  The HOMEPATH value in both "Volatile Environment" keys is blank.  The other value/data pairs are correct.  I looked on another Windows XP PC, and the HOMEPATH data was correct, not blank.  So I tried setting my HOMEPATH key's data to its correct value.  This did not work (the variable still does not appear when in a command shell) and they return to blank after a reboot... so Windows is getting the HOMEPATH value from someplace else and using it to set the Volatile Environment data in the registry.

 

So there's a real problem here.  I searched the web, but no one seems to have any idea where Windows gets the values it assigns to these variables (and to the registry data), or how they might be repaired when something goes wrong.

 

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

A little more information, and this one's truly baffling...

 

Under Computer Management I changed my Home Folder to a different path using the Administrator account then logged back in.  HOMEPATH was properly set to the new path.  Aha! Now all I have to do is change it back, right?

 

Nope.  I changed it back to my original Documents and Settings subdirectory, logged back in, and HOMEPATH was missing/blank again.

 

Pete.

 

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Solved!  That last reply I posted got me to thinking it might be a permissions problem, and it was.  The SYSTEM group somehow lost access rights to my home folder, and granting it permission solved the issue.

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Thank you for letting us know that you resolved it.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated March 23, 2020 Views 2,804 Applies to: