Changing default user data folders during install

Shadow81

New member
Local time
10:52 PM
Messages
3
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 Computer

Computer Manufacturer/Model Number
Self-Built
OS
Windows 7 Ultimate x64
CPU
Intel i7 920 @ 4.20GHz
Motherboard
Gigabyte
Memory
6Gb OCZ DDR 3
Graphics Card(s)
ATI
Monitor(s) Displays
50" Pioneer KRP-500
Screen Resolution
1920 x 1080
Hard Drives
OCZ RevoDrive 80Gb - Windows 7
5 x Seagate 1Tb Drives - RAID 5 - Data
Case
Antec 900
Cooling
Water
Internet Speed
50Mb
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 Computer

Computer Manufacturer/Model Number
Self-Built
OS
Windows 7 Ultimate x64
CPU
Intel i7 920 @ 4.20GHz
Motherboard
Gigabyte
Memory
6Gb OCZ DDR 3
Graphics Card(s)
ATI
Monitor(s) Displays
50" Pioneer KRP-500
Screen Resolution
1920 x 1080
Hard Drives
OCZ RevoDrive 80Gb - Windows 7
5 x Seagate 1Tb Drives - RAID 5 - Data
Case
Antec 900
Cooling
Water
Internet Speed
50Mb
Consider a backup image stored externally as preferable to the old-style Recovery Partition which is lost with a HD failure.

Win7 backup imaging can do it all at once and keep it updated by engaging Backup: Backup User and System Files
 
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 Computer

OS
Windows 7 Home Premium 64bit
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.
 
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 Computer

Computer Manufacturer/Model Number
Self-Built
OS
Windows 7 Ultimate x64
CPU
Intel i7 920 @ 4.20GHz
Motherboard
Gigabyte
Memory
6Gb OCZ DDR 3
Graphics Card(s)
ATI
Monitor(s) Displays
50" Pioneer KRP-500
Screen Resolution
1920 x 1080
Hard Drives
OCZ RevoDrive 80Gb - Windows 7
5 x Seagate 1Tb Drives - RAID 5 - Data
Case
Antec 900
Cooling
Water
Internet Speed
50Mb
Back
Top