My employer has an Active Directory group policy which sets my Windows 7 laptop HOMEDRIVE to "M:" (a mapped network drive) and my HOMEPATH to "\". Since I have read-only permissions for the root of that shared drive, I cannot create files or directories in my windows home directory. My attempts to work with the IT department have been unsuccessful.

Is there a way for me to globally change these envars at boot or login time? I need for all applications to use alternate values (such as "C:" and "\Users\myname"). I have some installed utilities (like gvim and others) that store preference files in the user's home directory.

IMPORTANT: Changing these envars under "System Properties > Environment Variables" does not work. I have tried setting these as both User and System Variables (including a reboot). TypingSET HOMEin a DOS window clearly shows that my settings are ignored. Also, using "Start in" in a Windows shortcut will also not solve this, as I need things like Explorer context menu items (like "Edit with Vim") to operate correctly.

I do have admin rights on this company laptop, but I am not a Win7 guru. Back in the day, a boot script would have solved this in a minute. Is it even possible today? Thanks.

link|improve this question
1  
Your IT department have set these policies for a reason. If you have tried to work it out with them and they have refused to change it there's probably a good reason. If you then continue to ignore their advice and go against what they've asked prepare for disciplinary action if you're caught. – Joe Taylor Mar 10 '11 at 15:16
2  
After over 30 years in this industry, I've learned that IT policy for the average PC user is often inadequate (or even obstructive) for developers and power users. IT often has had to accommodate the needs of developers differently, and if this is another such learning experience for them here, then I'm glad to help. I'd love to hear a valid business reason for making a user's home directory unusuable. – MikeC Mar 10 '11 at 15:32
The why not escelate the problem, show it is unworkable for certain users and propose a separate GPO for such users. Moving in this constructive way is far more likely to work than trying to bypass the domain policies with hacks. – Joe Taylor Mar 10 '11 at 16:17
I don't disagree, and I haven't given up on working with IT. The ball is in their court at the moment (and has been for almost 2 weeks). I've stated my need clearly. Regardless, I need to get my work done. Since it's a problematic (rather than blocking) issue, I'm waiting to escalate until my ticket expires or gets closed. But even that doesn't guarantee results, since my ticket owner is the IT manager. Thanks for the comments. – MikeC Mar 10 '11 at 16:35
1  
IT finally got back to me. They aren't going to change anything. Yes, official company policy is to provide a user home directory where I am not allowed to create files. Windows applications that attempt to use the default user home directory for things like preference files will fail. Is there no wizard here who can offer me some workaround to this? – MikeC Apr 5 '11 at 16:49
feedback

migrated from stackoverflow.com Mar 10 '11 at 14:49

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

1 Answer

I think these paths are automatically set to the place where your user profile is. The home drive you're referring to is the place where your ntuser.dat and application data and other user profile folders are, correct? Back with NT3.x, the "user profile" was just your user registry hive with settings and you could set a separate home path for each user. Those got unified together in NT4 as a user profile with a desktop, my documents, start menu, etc.

The locations of all the profiles are stored in registry keys under

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList

You will find some values for the special profiles, and subkeys: one for each active profile on the system. They are set up by the SID of the user account they belong to. The easiest way to find yours would be to scroll through each one looking for the right path (under the ProfileImagePath value). You should be able to just change that value to whatever path you want; it'll take effect the next time you log on. Be sure to copy your files to the new path first.

If you have to move the profile from the account you are logged in as (i.e. logged in as MikeC and you are trying to copy the profile for MikeC) the ntuser.dat file (the registry hive containing HKEY_CURRENT_USER) will be locked by the kernel. You can still copy the hive: go into regedit, right click on HKEY_CURRENT_USER, select export, change the type to registry hive files, and save as ntuser.dat at your new location.

In my experience if winlogon has a problem loading a profile because something is set up wrong, it'll either create a new copy from the default profile or give you a temporary copy to use for that session and you'll still be able to log in. However, I would recommend you have a different admin login to use on the system in case something goes wrong.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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