1

The application I want to use needs the HOMEPATH environment to be set in order to work flawlessly. It's usually no problem because it's set by default. Here's the cmd dump:

C:\Users\xxxx>set home
HOMEDRIVE=C:
HOMEPATH=\Users\bert

The problem comes when I try to elevate the application's privilage to Administrator (by right-clicking -> Run as Administrator). The application can't find the HOMEPATH. SO I try to run the same command as above in a cmd window that's also elevated. Lo and behold:

C:\windows\system32>set home
Environment variable home not defined

Why? And how can I fix this? I've search all over the place with no result :(

I'm also not sure how to set the HOMEPATH per user, as I find no sufficient documentation on this, both on MSDN and the Internet.

Thanks before.

EDIT TO PROVIDE MORE CONTEXT

I have two users on my machine, one is on the Administrator Group, and one as the normal user (Users Group). For my dialy use, I run under the normal user, and for the run as administrator command, I run as the other user. That user on the Administrator Group is not "Super-Admin" which require no UAC prompt, it is the user that's created when we install windows. Is there any information I need to add?

7
  • 1
    I can't replicate this: imgur.com/O9Nsv Mar 22, 2012 at 13:35
  • Are you running a standard CMD? Mar 22, 2012 at 13:45
  • Do you have the "Administrator" account enabled on your system? Mar 22, 2012 at 13:53
  • @techie007 yes, it is standard cmd.
    – bertzzie
    Mar 22, 2012 at 13:54
  • @OliverSalzburg what do you mean by the Administrator account? The one that needs no UAC prompt?
    – bertzzie
    Mar 22, 2012 at 13:54

1 Answer 1

2

When you 'run as Administrator' you're outside the user's context, so you may not have the user's environment variables (like HomePath) available to you.

Having said that, this isn't what I find. When I start a CMD (as Administrator), the HomePath is still the current user's Homepath.

Anyhow, to set a User's Homepath on a stand-alone Windows 7 machine navigate to Control Panel\User Accounts\User Accounts, click "Manage User Accounts", Click the Advanced Tab, click "Advanced" button.

You can also get there by clicking Start and search for "Edit local users and groups", or run "lusrmgr.msc".

Once there, double-click "Users" folder, right-click the user you want to modify, click "Properties", click the "Profile" tab.

You can set you HomePath (and other paths as well) for that user in there.

enter image description here

2
  • I'm a little confused... Which textbox should I fill for the homepath?
    – bertzzie
    Mar 22, 2012 at 14:01
  • The homepath is defined by the Home folder Local path text box. This fixed my issue where a service's HOMEPATH was wrong.
    – JDiMatteo
    Jun 14, 2016 at 16:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .