Jump to content

Recommended Posts

Posted

I am trying to change the default "My Documents" directory to a directory on the D: drive (for backup purposes)

Now i've found out which regkey's i have to change during unattended installation, but the regkey's are not changed!

Even if i execute the .reg file after installation, the key's are NOT changed. (according to regedit)

here is the .reg file (It's a NL XP version):

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"Personal"="D:\Mijn Documenten"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"My Music"="D:\Mijn Documenten\Mijn muziek"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"My Pictures"="D:\Mijn Documenten\Mijn afbeeldingen"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"Personal"="D:\Mijn Documenten"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"My Pictures"="D:\Mijn Documenten\Mijn afbeeldingen"

[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"Personal"="D:\Mijn Documenten"

[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"My Music"="D:\Mijn Documenten\Mijn muziek"

[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"My Pictures"="D:\Mijn Documenten\Mijn afbeeldingen"

[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"Personal"="D:\Mijn Documenten"

[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"My Pictures"="D:\Mijn Documenten\Mijn afbeeldingen"

These key's won't change. Only direct editing them in regedit does the trick.

Anyone any ideas what i'm doing wrong? (Or other method's to change the "My Documents" location unattended?)


Posted

@BlueFlame

First of all you only need to Edit the User Shell Folders keys in HKEY_CURRENT_USER.

Secondly, If you edit the now necessary three keys, by hand in the Registry Editor, then export them to a reg file you will find that they are not string values, (REG_SZ), anyhow, which is where your problem lies!

Because the keys are of type REG_EXPAND_SZ, I would plump for a good old inf; Copy the following into a new notepad file and save it as redirect.inf:

;redirect.inf
[Version]
Signature=$CHICAGO$

[DefaultInstall]
AddReg=Reg.Settings

[Reg.Settings]
HKCU,%PATH%,Personal,0x20000,"%PERSONAL%"
HKCU,%PATH%,My Pictures,0x20000,"%PICTURES%"
HKCU,%PATH%,My Music,0x20000,"%MUSIC%"

[Strings]
;Non-Editable Strings
PATH="Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders"

;Editable strings
PERSONAL = "D:\%USERNAME%\Mijn Documenten"
PICTURES = "D:\%USERNAME%\Mijn Documenten\Mijn afbeeldingen"
MUSIC = "D:\%USERNAME%\Mijn Documenten\Mijn muziek"

Edit the three string values at the end of this file to suit your setup, then apply it by putting it in your $OEM$ folder and calling it from Cmdlines.txt by adding the following below [Commands]:

"rundll32.exe setupapi,InstallHinfSection DefaultInstall 128 .\redirect.inf"

I hope that answers your questions!

[EDIT] If you want to test it first, just right click on redirect.inf and choose install, then Reboot your computer for it to take effect. [/EDIT]

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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