Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Changing default user data folders during install


12 Dec 2011   #1

Windows 7 Ultimate x64
 
 
Changing default user data folders during install

Hi,

I have found some amazing tutorials on this website which achieve ALMOST what I am aiming for... but nothing that quite matches what I am trying to achieve.

I build, and then support many computers for my friends and family. I have recently started making them feel a bit more "manufactured" by using a factory-style recovery option (press F9 at boot to enter recovery / uses a hidden recovery partition etc...).

The issue I have though, is I often get asked to "wipe" someone's computer following a virus/malware infestation (and yes, I do supply AV, but that isn't always enough).

So, I use Sysprep to install all additional software, drivers etc... but the one problem I have is that I like to have, and usually always configure PC's to store items like Documents/Pictures/Music/Videos etc... on a seperate partition.

The problem is, when I configure this in Sysprep - the settings are lost when the user completes OOBE.

Ideally, I do not want to move the entire "Users" directory, I just want the libraries to never look at any folders on the C: drive, only the ones on D: (D:\%USERNAME%\Documents etc...).

I want it so that when files "detect" where to save, it locates the appropriate directory on the D: drive, so they dont have to always manually locate the folders.

The reason I dont want the entire "Users" folder on D: is that following a restore or 2, it will get messy...

I would like to either automate this during setup, or would happily take a manual approach during Sysprep - as long as it applied these settings to all users as and when they are created.

I would like the cleanest way to do this, ideally without junctions/symlinks.

Thanks in advance to anyone who can assist me!


My System SpecsSystem Spec
.

12 Dec 2011   #2
Microsoft MVP

 

This may help, or perhaps Kari will have some customized ideas for you:
User Profiles - Create and Move During Windows 7 Installation
My System SpecsSystem Spec
13 Dec 2011   #3

Windows 7 Ultimate x64
 
 

Hey, thanks, that was an option I had already looked at, but I did not want to move the entire "Users" directory ideally, just the folder like Documents, Photos, Music, Downloads etc... (the folders where users are most likely to store their data). Mostly because I create manufacturer style recovery systems (Press F9 during boot, hidden recovery partition etc...) which I set to format C: (but leave D: alone). I like this as if malware/spyware outbreak leaves system in a state that ideally should be wiped - they can use recovery, and it will restore system to post-sysprep state, but leave their data intact.

Anyway, I have found a script that almost does what I want - and I loaded the NTUsers.dat hive in the registry at sysprep stage, and added this script to the RunOnce section. For admin accounts, works a treat, but does not work with Standard accounts yet (not even with Hstart) - converted it to an exe with an administrator manifest - and will be try that out tonight... Will report back
My System SpecsSystem Spec
.


13 Dec 2011   #4
Microsoft MVP

 

Consider a backup image stored externally as preferable to the old-style Recovery Partition which is lost with a HD failure.

Windows 7 backup imaging can do it all at once and keep it updated by engaging Backup: Backup User and System Files
My System SpecsSystem Spec
27 Dec 2011   #5

Windows 7 Home Premium 64bit
 
 

Quote   Quote: Originally Posted by Shadow81 View Post
Hey, thanks, that was an option I had already looked at, but I did not want to move the entire "Users" directory ideally, just the folder like Documents, Photos, Music, Downloads etc... (the folders where users are most likely to store their data). Mostly because I create manufacturer style recovery systems (Press F9 during boot, hidden recovery partition etc...) which I set to format C: (but leave D: alone). I like this as if malware/spyware outbreak leaves system in a state that ideally should be wiped - they can use recovery, and it will restore system to post-sysprep state, but leave their data intact.

Anyway, I have found a script that almost does what I want - and I loaded the NTUsers.dat hive in the registry at sysprep stage, and added this script to the RunOnce section. For admin accounts, works a treat, but does not work with Standard accounts yet (not even with Hstart) - converted it to an exe with an administrator manifest - and will be try that out tonight... Will report back
I'm in the same boat. I'm trying to decide whether to follow Kari's tutorial or simply find an elegant way to move only Documents, Photos, Musis, Videos, Download etc folders.

Your wrote that you found a script that works well for admin accounts. Do you mind sharing it? Insofar as I will likely have only one account on this computer and it will have admin privileges, it may work for me. Thanks.
My System SpecsSystem Spec
27 Dec 2011   #6
Microsoft MVP

 

You can link any folders on your System or even another network computer by adding them to a Library: Library - Include a Folder - Windows 7 Forums

I no longer link all User folders to a separate data partition after receiving permission issues when trying to install from my Downloads folder on another partition. I do link a large video library on separate HD.
My System SpecsSystem Spec
28 Dec 2011   #7

Windows 7 Ultimate x64
 
 

Hey, I haven't found a solution yet for "Standard" user accounts (I would just like to totally remove the ability to create standard accounts to be honest - they suck) - but here is the solution that works for admin accounts:

Download the script located here:

User Profile Redirection - MSFN Forum

I do NOT recommend using Hstart as the author does - what I did was convert the cmd to an exe using a free tool and chose to run it in "Ghost Mode" (a setting within the tool). But if you are happy with it as a .cmd then there is no need for either.

Save the script to C:\Profiler\

(or ammend the example below accordingly)!

Then, either at Sysprep, or once logged on (depending on how you configure yours) open Registry Editor.

Highlight HKEY_USERS - and then click on "File" on the menu.

Next, click "Load Hive", and browse to "C:\Users\Default User" - and select NTUser.dat (hidden file - so make sure show hidden files and show protects OS files has been configured).

It will ask you to provide a name for the hive - lets say you called it "UserProfiles" for this example.

Now, navigate through registry to the following location:

HKEY_USERS\UserProfiles\Software\Microsoft\Windows\CurrentVersion\Runonce

and add a new key here called "UserProfileRelocate" (you can name it anything you want)

Give it the value in accordance with how you want to run the script. For example, if you want the script to:

Run silently, without prompting (unless there is an error)
Move User profiles to D:\Users\%USERNAME%
Leave Public profile where it is

Then you would add the command:

C:\Profiler\moveshl.cmd /u:"D:\Users\%USERNAME%" /q

It is recommended to maintain the \Users\%USERNAME% structure, but you don't have to - you could just have D:\%USERNAME% if you prefer.

Ok, so - click on the root of the hive again (HKEY_USERS\UserProfiles) - and click "File" --> "Unload Hive".

Thats it... now, whenever you create a user, this script will run once, at first logon.

It covers all scenario's too - it creates junction points as well as moving data - so that badly coded apps that have the location C:\Users\%USERNAME% etc... hardcoded in them can still operate perfectly, whilst actually storing the data on the other drive/partition.

This will run on every new user account - Admin or standard - BUT - it will cause an error on Standard accounts and not complete.

Phewf! I hope this helps answer your query!



My System SpecsSystem Spec
Reply

 Changing default user data folders during install




Thread Tools



Similar help and support threads for2: Changing default user data folders during install
Thread Forum
Changing Default Icon for Full Folders Themes and Styles
Solved Changing default view for folders with audio files Customization
Solved Deleting extra User Folders and changing permissions General Discussion
Solved Default user folders after windows install General Discussion
Changing Default Folders? Customization
Changing Default Installation Folders Software
New user folders and default locations Customization

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 12:48 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33