Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
1  
I can't replicate this: imgur.com/O9Nsv –  Oliver Salzburg Mar 22 '12 at 13:35
    
Are you running a standard CMD? –  Ƭᴇcʜιᴇ007 Mar 22 '12 at 13:45
    
Do you have the "Administrator" account enabled on your system? –  Oliver Salzburg Mar 22 '12 at 13:53
    
@techie007 yes, it is standard cmd. –  bertzzie Mar 22 '12 at 13:54
    
@OliverSalzburg what do you mean by the Administrator account? The one that needs no UAC prompt? –  bertzzie Mar 22 '12 at 13:54

1 Answer 1

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

share|improve this answer
    
I'm a little confused... Which textbox should I fill for the homepath? –  bertzzie Mar 22 '12 at 14:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.