Jump to content

Move "My Document" to another partition or drive


Recommended Posts

Ok, so I have been experiment with unattended installations lately and was wondering something. I almost always move "my documents" to another partition when installing so I can keep all my data and junk somewhat separate and would like to know if I can do this automatically during the installation.

Any help would be greatly appreciated!

Link to comment
Share on other sites


I don't know exactly how, but that is controlled via a registry key...it's per user so you'll probably need to mess with the default profiles reg hive...here's the key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

In that there are several items...all can be changed to a local drive or UNC. Even though it's called "My Documents" in the registry it's called "Personal"...you should be able to figure it all out, as they have the value listed so it's simple.

Link to comment
Share on other sites

Why not keep the important stuff, My Documents, Cookies, Favourites and any others you want permanently on say D:\ ? Copy these folders to the destination drive, then edit these registry keys to point the system to them;

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]

Once you have done that, restart the system, then, simply export those keys, and apply them during T12 (cmd). Hope that helps. :hello:

Link to comment
Share on other sites

I did this to my unattended setup:

[GuiUnattended]
   ProfilesDir = "D:\Documents and Settings"

This is in my unattend.txt and moves all of the "my docs, music, pics etc folders to D:\Documentys and Setings.

You will of course have to have a D drive first, I create this using diskpart.

You have to make a folder called D under your $oem$ folder, and a "Documents and Settings" folder under the D folder.

I use this in an enterprise enviroment and works great for reloads.

Link to comment
Share on other sites

CODE

[GuiUnattended]  ProfilesDir = "D:\Documents and Settings"

This is the more technically correct way to move the My Docs folder as it will move everything to do with a users my documents including the more important stuff like the "local settings" folder which contains the application data (outlook *.pst files).

I know you can move the mydocs folder and path for the default location of *.pst files but that has to be done per user from my experience (pls correct if i'm wrong) and is specific only to those folders. Also by default new users on those PC's will have their folders created in the M$ default path ie "c:\documents and settings" not the non standard (your chosen) path!

Link to comment
Share on other sites

what will happen if i got only single drive

c:\ only

The install will fail with an error. Can't remember the exact error. I use a batch process with bartpe to run diskpart. Create 2 partitions, c&d, format quick with ntfs then run winnt32.exe.

I also have a D folder in my $OEM$ folder. In the D folder is a folder called Documets and Settings. During the install process, the Documents and Settings folder get copied to the D drive automatically. I do this to lessen the chance of errors created.

Link to comment
Share on other sites

If you use WIHU, you can set it up that it will create the My docs etc on for example D:\ and that it will have the name of the User account.

With wihu you can create users very easy at the end of your unattended install.

I have it like this:

The last item in my RunOnceEx is Wihu.

It starts, now user accounts can be created. Next.

Now some optional software can be selected. Finish.

wihu performs the tasks and after reset, it is like this:

Created 2 users: John and Maria:

My documents = D:\John

My pictures = D:\John\My pictures

My dowloads = D:\John\My downloads

My documents = D:\Maria

My pictures = D:\Maria\My pictures

My dowloads = D:\John\My downloads

Music = D:\Music

Movies = D:\Movies

Downloads = D:\Downloads

Shared Docs = D:\Shared Documents

The nice thing about Wihu, if you have created 2 partitions at the beginning of Windows Setup, only the partition on wich you install Windows is formatted, right?

so the second one has to be formatted before these folders can be created!

If wihu detects this situation, it will automatically format the partition.

BTW: I don't recommend placing the Documents & Settings folder apart... since this folder contains a lot files that are totally not of any use if you would for example reinstall the C drive...

so I just have the documentfolders above apart... and the "Documents & Settings" still on C, but without my docs or shared docs or so.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
CODE

[GuiUnattended]

   ProfilesDir = "D:\Documents and Settings"

This is the more technically correct way to move the My Docs folder as it will move everything to do with a users my documents including the more important stuff like the "local settings" folder which contains the application data (outlook *.pst files).

I know you can move the mydocs folder and path for the default location of *.pst files but that has to be done per user from my experience (pls correct if i'm wrong) and is specific only to those folders. Also by default new users on those PC's will have their folders created in the M$ default path ie "c:\documents and settings" not the non standard (your chosen) path!

I found some info on micorsoft.com:

http://support.microsoft.com/default.aspx?...kb;en-us;236621

Can anyone tell me if the "d:\documents and settings" directory already exists, would it use what is there? That would be useful to me for a quick reload of c: drive without worrying about docs, .pst, favorites and such.

B)

Link to comment
Share on other sites

Can anyone tell me if the "d:\documents and settings" directory already exists, would it use what is there? That would be useful to me for a quick reload of c: drive without worrying about docs, .pst, favorites and such.
No, it won't because the user account SIDs will be different. On the first install you would end up with, for example:

D:\Documents and Settings\Administrator\

D:\Documents and Settings\All Users\

D:\Documents and Settings\Default User\

D:\Documents and Settings\JoeBlowDomainUser\

A reinstall would leave the original folder, however it will create a new profile for the user. You'll end up with things like:

D:\Documents and Settings\Administrator.computername\

D:\Documents and Settings\All Users.computername\

D:\Documents and Settings\Default User.computername\

D:\Documents and Settings\JoeBlowDomainUser.domainname\

The profiles from the previous install will still be left intact...they just won't be used. This also happens if you do a reinstall on the C: drive without a reformat.

Link to comment
Share on other sites

I use a batch process with bartpe to run diskpart. Create 2 partitions, c&d, format quick with ntfs then run winnt32.exe.

I also have a D folder in my $OEM$ folder. In the D folder is a folder called Documents and Settings. During the install process, the Documents and Settings folder get copied to the D drive automatically. I do this to lessen the chance of errors created.

Q: Are you first booting to PE doing sysprep, diskpart, etc, then booting into your unattended install? Or are you booting into PE and then just executing your install from within PE? (I'm new to PE).

Q: When you run your diskpart script from within PE to create your drives, do the drive letter assignments survive into your unattended installation?

Q: Could you post your diskpart script as an example?

Thanks in advance!

Link to comment
Share on other sites

I just boot into PE and run an unattened install over the network.

This is the batch file I call up...

net use z: \\crp16237\windist

diskpart /s z:\diskpart.txt

format c: /q /fs:ntfs /v:System /y
format D: /q /fs:ntfs /v:Data /y

echo Starting XP install...

set AnswerFile=\\CRP16237\windist\unattend2.txt
set SetupFiles=\\CRP16237\windist\I386


\\CRP16237\windist\I386\winnt32 /makelocalsource /tempdrive:C: /syspart:C: /s:%SetupFiles% /unattend:%AnswerFile%

DiskPart.txt file..

select disk 0
Clean
create partition primary size 8000
assign letter C
active
select disk 0
create partition extended
create partition logical
assign letter D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...