Jump to content

moving my documents


Recommended Posts


use this registry key

for all users

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"Common Documents"=hex(2):44,00,3a,00,5c,00,44,00,6f,00,63,00,75,00,6d,00,65,\
00,6e,00,74,00,73,00,00,00

for user

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"Personal"=hex(2):44,00,3a,00,5c,00,4d,00,79,00,20,00,44,00,6f,00,63,00,75,00,\
6d,00,65,00,6e,00,74,00,73,00,00,00

Edited by The Black Cloud
Link to comment
Share on other sites

@costi

If the code scares you, open regedit, locate the keys, make the changes manually, and then export the keys. That way you won't depend on someone else's code.

Nothing against The Black Cloud's post, though.

Link to comment
Share on other sites

I tried to use this code (I'm testing the install on Virtual PC), but it when I try to import it it says it's not a correct code and doesn't integrate it o.O

I'll try manually and see what I'll get.

While we're on the subject:

I have a different setup on my machine - I moved the whole "Documents And Settings" folder to partition D: (D:\documents and settings) using junctions from Win2k (linkd.exe tool).

If anyone's familiar with this technique, can you tell if there's a way to backup the existing junctions and restore them after reinstall?

I have a multi-user setup and creating the junctions is kinda tricky. Last time I was doing it, it took me 3 hours of trial and error - you can imagine I don't feel like going through that again.

If copying them is not an option, any other way of migrating Documents And Settings to a different location is welcome.

Link to comment
Share on other sites

@costi

The solution above moves My Documents folder, not Documents and Settings. In order to move the entire Documents and Settings you'd better use

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

I never tried to backup and restore the junction points, can't help you.

Link to comment
Share on other sites

"bobthenob: have you tried it? Did it work?"

Hi sorry I havent replyed ive been busy. No i coudnt get it to work

Do i need to add anything to the reg code?

I tryed it on my virtal machine didnt move it ?

thanks

Edited by bobthenob
Link to comment
Share on other sites

@costi

The solution above moves My Documents folder, not Documents and Settings. In order to move the entire Documents and Settings you'd better use

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

I never tried to backup and restore the junction points, can't help you.

Thanks, I'll try that.

I have just one worry about it - won't it overwrite existing folders/settings? Or will this just use the existing ones?

Link to comment
Share on other sites

The following batch file should suffice

@ECHO OFF&SETLOCAL ENABLEEXTENSIONS
SET DRIVE=D:
SET USF=Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
SET MYDOC=%DRIVE%\%%USERNAME%%\My Documents
SET MUSIC=%MYDOC%\My Music
SET PICS=%MYDOC%\My Pictures
REG ADD "HKCU\%USF%" /V "My Music" /T REG_EXPAND_SZ /D "%MUSIC%" /F >NUL
REG ADD "HKCU\%USF%" /V "My Pictures" /T REG_EXPAND_SZ /D "%PICS%" /F >NUL
REG ADD "HKCU\%USF%" /V Personal /T REG_EXPAND_SZ /D "%MYDOC%" /F >NUL
ENDLOCAL&GOTO :EOF

Just change the second line to suit!

Link to comment
Share on other sites

@Yzöwl

Cool! That's for the post-installation phase. winnt.sif is shorter, but it works only during install.

Can you explain this line please

SET MYDOC=%DRIVE%\%%USERNAME%%\My Documents

What's the %USERNAME% for?

I love quick edit feature ;)

Edited by Vadikan
Link to comment
Share on other sites

%USERNAME% has been used so that each current or future user will have their own personal folder with the same name as their login name. This folder will be the container for their personal files.

If the D: drive, in this case, is using NTFS, then these folders should hopefully be private, security wise, to disallowed users.

Link to comment
Share on other sites

Are you sure you need the double %%? I think they'll result in D:\%USERNAME%\. Try

@ECHO OFF&SETLOCAL ENABLEEXTENSIONS

SET DRIVE=D:

REM ~ SET USF=Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders

REM ~ SET MYDOC=%DRIVE%\%%USERNAME%%\My Documents

ECHO %USERNAME%
ECHO %DRIVE%\%%USERNAME%%\
ECHO %DRIVE%\%USERNAME%\

PAUSE

Link to comment
Share on other sites

@Yzöwl

When should I run the batch file? During install (cmdlines.txt?) or after install?

Does the SETDRIVE line include the whole path to a user's folder (so if I want to have folders organized as D:\Documents And Settings\USERNAME I should put the whole D:\Documents And Settings as the value of SETDRIVE)?

Also, I assume it uses already existing folders? It's important for me, since I want to install on my current comp, where all the user data is already there.

Sorry for the probably noobish questions, but it's the first time I'm doing an unattended CD and I don't want to screw things up (especially not something as important as this :) ).

Link to comment
Share on other sites

i moved my documents to "e:\docs"

heres my reg tweak that works...

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"Personal"="E:\\DOCS"
"My Pictures"="E:\\DOCS\\My Pictures"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"Common Documents"="E:\\DOCS"
"CommonPictures"="E:\\DOCS\\My Pictures"

i call it at cmdlines.txt

:)

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...