Jump to content

My Documents


estman

Recommended Posts

Hi,

I'd like to change the location of the My Documents folder from "C:\Documents and Settings\username\My Documents" to e.g. "D:\username\My Documents" during the XP Unattended installation. The problem is that I need to do this for 3 user so I can't use the registry values under

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

because it only changes the settings for the current user. The files are already in the new location so I don't need to copy any files, just to change the location for Windows.

I used to do it after the Windows installation by logging in under every user and changes the location by changig the "Target" value under My Documents' Properties\Target tab but it's quite dull that way.

I'd prefer to use a batch file to do this.

Thank you!

Link to comment
Share on other sites


hi,

i have a question. If you apply the tweak with cmdlines.txt, the tweak must be in a separate process as RunOnceEx or should be call by it. Cause in my unattended installation, when i create a new users just some parts of the tweak are really apply, some don't. Do you know why ? Is there a better way to be sure apply settings are for all new users created ?

Link to comment
Share on other sites

Thanks for the replys,

but in my understanding, if I have e.g. "user1", "user2", "user3" and use the cmdlines.txt, all of the users' My Documents would be in "D:\user1\My Documents" ? I'd like to have:

for user1: "D:\user1\My Documents"

for user2: "D:\user2\My Documents"

for user3: "D:\user3\My Documents"

Please correct me if I'm wrong and thanks again for your replys.

Link to comment
Share on other sites

estman

Have a look at this thread: http://www.msfn.org/board/index.php?showto...ndpost&p=183075

I am usinig the script offered by idle.newbie.

I added moving My Documents to D:\Docs for all users but I think there is a way to do it in separate folders for a few users just look at the rest of the script in that thread.

My addition (sorry if it is not absolutely correct):

if (home == "%HOME%") home="D:\\Docs";
WshShell.regWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\My Pictures", home + "\\Pix\\", "REG_EXPAND_SZ");
WshShell.regWrite("HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders\\Personal", home, "REG_EXPAND_SZ");

There is only one issue with this script for me - it works when I start it manually but the "My Documents" part doesn't work during RunOnceExe in my Windows 2000 Proffesional if I add shutdown command. I'm working on it.

And there is one mor thread is going on http://www.msfn.org/board/index.php?showtopic=26586 that makes me thinking about another possibilities of doing that.

Regards,

Oleg 2

Link to comment
Share on other sites

Tsunami is right. apply that @T-12.

all UserShellFolders regEntries are REG_EXPAND_SZ, so you can use environment variables. i got several lines in my .cmd batch @T-12:

SET KEY=HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
 REG ADD "%KEY%" /f /v "Desktop"     /t REG_EXPAND_SZ /d "D:\HOME\%%USERNAME%%\Desktop"
 REG ADD "%KEY%" /f /v "Personal"    /t REG_EXPAND_SZ /d "D:\HOME\%%USERNAME%%\Documents"
 REG ADD "%KEY%" /f /v "Favorites"   /t REG_EXPAND_SZ /d "D:\HOME\%%USERNAME%%\Favorites"
 REG ADD "%KEY%" /f /v "My Pictures" /t REG_EXPAND_SZ /d "D:\HOME\%%USERNAME%%\Documents\My Pictures"

it maps every users' Desktop/MyDocuments/Favorites to D:\Home\userName. better let MyPictures below MyDocuments, or sometimes the Explorer works geek. my script came from a friend, but the original idea came from GreenMachine, you can search "NetUser.exe or CUsrMgr.exe" in this forum.

Link to comment
Share on other sites

Changing ProfilesDir in winnt.sif to another disk should work, but next time you reformat your system, user profiles with the same name will change to userName.domainName, i don't like that.

but UserShellFolder way will cause another ACL problem, the folderOwner/fileOwner in Properties -> Security page, you'll find some ghost entry after next reformat, the old-SID belongs to nobody so it looks strange, and i use scripting to do some CACLS thing.

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