Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have got a laptop which is configured to have the user profile in a network drive. This is causing me a lot of headaches since the connectivity to my company is very slow. I want to relocate the profile of my user into a local directory. How do I do that?

Those are the settings at the moment:

C:\>set HOME

The drive P is a network drive mapped to HOMESHARE.

I can't find where windows is setting those environment variables, not even in the registry.

The laptop is running Windows XP.

share|improve this question

migrated from Feb 16 '11 at 21:52

This question came from our site for professional and enthusiast programmers.

up vote 14 down vote accepted

I had a similar problem, which caused problems with msysgit. Here is the solution I used, and it definately worked for me. This answer is similar to this and that SO post.

  1. If you are on Windows 7, you can skip this step. If you are on Windows XP, download and install Windows XP Service Pack 2 Support Tools which contains SETX, a utility, described on SS64 and technet, that lets you set permanent system and user variables. You must have administrative rights to set global system variables. The basic usage is SETX <variable> "<value>" [-m].

  2. Add the following script to your startup folder - W7: "C:\Users\<username>\Start Menu\Programs\Startup" and XP: "C:\Documents and Settings\<username>\Start Menu\Programs\Startup".

    SETX HOMEPATH "\Documents and Settings\%USERNAME%" -m
    SETX HOMESHARE "\\<server>\<share>" -m
    SET HOME=%SYSTEMDRIVE%\Documents and Settings\%USERNAME%
    SET TEMP=%HOME%\Local Settings\Temp

Note: SETX variables are permanent, but are not available until after the script runs, so use SET to create temporary variables in your script. Also uses double quotes around the value you want to set your variable to in case it has spaces, but this is not necessary for SET. Machine variables are set with the -m option; user variable is the default. Windows 7 has many more options and uses / instead of -.

share|improve this answer

There's a good chance that whatever you change will just get put back the next time you attach to the domain (via Group Policies or alike).

Have you considered asking your company's IT folks if they can change that for you?

Perhaps create a local user on the laptop for use when outside of the domain, that way you're not waiting for these slow-link shortcuts, nor are you trying to circumvent the domain user settings as laid out by the company.

share|improve this answer
That's the beauty of Windows. Even if you are root somebody else decides what your OS will do. – Luigi R. Viggiano Feb 17 '11 at 22:11
No that's the beauty of having a job where they supply and control the computers. OR it's the beauty of being able to unify and centrally manage a network full of company computers that users keep trying to hack at because they think it's their's. Windows has nothing to do with your boss deciding how you use company resources (notebook, network, etc.). ;) – Ƭᴇcʜιᴇ007 Feb 17 '11 at 22:31
No that's the beauty of an ecosystem that makes it easy for power-tripping monkeys to play God with no care or concern for how it impacts productivity. – nathanchere Apr 1 '15 at 14:09

I have a similar problem in my corporate environment, and developed a variety of hacks and work-arounds. With my current setup the following values are forced by the domain:

set HOME

But with my workaround, the resulting mappings are:

HOMEDRIVE => G: => \\Server\Users\username => C:\Users\username
HOMESHARE       => \\Server\Users\username => C:\Users\username

While other server paths / drive mappings go to the remote server:

O: => \\Server\Example => \\Real_Server\Example
      \\Server\Example => \\Real_Server\Example

These have only been tested in Windows 7, but I would imagine that they will also work in Windows XP if you have the mklink tool.

share|improve this answer
Thanks for the suggestion; at the end I managed to have some programs (like java apps, mingw, etc) use a different home folder; I had to configure or hack those apps to trick them, but it worked. I left the company now, so I cannot verify wether your solution applies well to my case, but your hacks are the things I was hoping to get when I posted this question. – Luigi R. Viggiano Oct 29 '12 at 8:53

They're in the advanced system properties. On Vista/Win 7:

  1. Right-click "My Computer"
  2. Select "Properties"
  3. Select "Advanced System Settings" (link on left side of window)
  4. Select "Advanced" (tab)
  5. Select "Environment Variables" (button)
share|improve this answer
Thanks, but the laptop is running Windows XP (I updated the question with this detail). And those variables are not visible nor editable from the system settings. – Luigi R. Viggiano Feb 16 '11 at 20:47
Some of them are just present in the environment for information, and are set/stored elsewhere. HOMEDRIVE/HOMEPATH are the home directory as set in the account's configuration in "Users and Accounts". Try running 'lusrmgr.msc' (local users and groups manager). Some of the advanced path settings are managed via that. – Marc B Feb 16 '11 at 20:49
Unfortunately my user is a domain user (not local) so it's not listed in the local users and group manager. – Luigi R. Viggiano Feb 16 '11 at 20:56
Then you'd have to get it modded on the domain controller, which is where such things are kept for domain accounts. The other option is to just use a local account with access to the domain account's files for when you're offsite – Marc B Feb 16 '11 at 21:00
Thanks I'll check that (the domain controller). Found on Wikipedia: – Luigi R. Viggiano Feb 16 '11 at 21:34

You must log in to answer this question.

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