Jump to content

Recommended Posts

Posted

Hi Im tyring to make a Cmd file or Autoit file that moves

my documents

from c: to D: partion if exsit

I always move documents to D:when i install windows

i cant think how to start this

cheers


Posted (edited)

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
Posted

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

Posted

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.

Posted

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

Posted (edited)

"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
Posted
@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?

Posted

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!

Posted (edited)

@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
Posted

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

Posted

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

Posted

@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 :) ).

Posted

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

:)

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