Oleg_II Posted December 22, 2005 Share Posted December 22, 2005 My 2c redirect.infVersion]Signature=$CHICAGO$[DefaultInstall]AddReg = Reg.Settings[Reg.Settings]HKCU,"Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","Personal",0x00000,"D:\Docs"HKCU,"Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","My Pictures",0x00000,"D:\Docs\Pix" Link to comment Share on other sites More sharing options...
Yzöwl Posted December 22, 2005 Share Posted December 22, 2005 (edited) Are you sure you need the double %%? I think they'll result in D:\%USERNAME%\.Yes I'm sure, the key is reg_expand_sz for that reason. Otherwise I would have said@ECHO OFF&SETLOCAL ENABLEEXTENSIONSSET DRIVE=D:SET USF=Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell FoldersSET MYDOC=%DRIVE%\%USERNAME%\My DocumentsSET MUSIC=%MYDOC%\My MusicSET PICS=%MYDOC%\My PicturesREG ADD "HKCU\%USF%" /V "My Music" /D "%MUSIC%" /F >NULREG ADD "HKCU\%USF%" /V "My Pictures" /D "%PICS%" /F >NULREG ADD "HKCU\%USF%" /V Personal /D "%MYDOC%" /F >NULENDLOCAL&GOTO :EOFAlso, the Windows NT Command Script syntax uses :: for a remark /comment not the old batch method of REM.<Edit>costi During install</Edit> Edited December 22, 2005 by Yzöwl Link to comment Share on other sites More sharing options...
Vadikan Posted December 23, 2005 Share Posted December 23, 2005 (edited) @YzöwlThere are two different questions in this thread, and I don't think your solution answers both. See PM, please Edited December 23, 2005 by Vadikan Link to comment Share on other sites More sharing options...
BrandonS_Mil Posted December 23, 2005 Share Posted December 23, 2005 You can use nlite to auto set your "user" profile to "install" anywhere....i.e. you allways more it to "d:\" right?? When XP installs, it will set the directory to be "CREATED" where you say.... no more moving.... Link to comment Share on other sites More sharing options...
Yzöwl Posted December 23, 2005 Share Posted December 23, 2005 The only two questions from the opening gambit as I see it are1. How to determine if D: exists2. How to move 'My Documents' to D:The only code I and no other respondee gave was one to search for the existence of D:. However as a simple fix for that a simple change to line 2 to this may helpIF NOT EXIST D: (GOTO :EOF) ELSE (SET DRIVE=D:)The later mention of junctions does however cause confusion. If the profiles directories are moved to D: then as a direct result of that move and as a container for the 'My Documents' folder the registry will be updated accordingly. As I stated earlier the 'User Shell Folders' data is by default of type REG_EXPAND_SZ. The keys in question by default use the %USERPROFILE% variable which in this case will expand to D:\Documents and Settings\Users_Name\My Documents..., thus negating the need for any additional changes. Link to comment Share on other sites More sharing options...
bobthenob Posted December 23, 2005 Author Share Posted December 23, 2005 Hi thanks for all the help Ill give some atry when i get Testing again Thanks Link to comment Share on other sites More sharing options...
Vadikan Posted December 24, 2005 Share Posted December 24, 2005 @YzöwlI guess my PM didn't impress you Ok, here's the quote 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.I imagine he has user documents under D:\Documents and Settings\Username\My Documents. I may be missing something, but I don't understand how your code helps in this case SET MYDOC=%DRIVE%\%%USERNAME%%\My Documentsimplies that each user will have My Documents folder as D:\Username\My Documents while the actual documents are stored elsewhere. Link to comment Share on other sites More sharing options...
Yzöwl Posted December 24, 2005 Share Posted December 24, 2005 @ VadikanI'm sorry for not responding to your PM, the point I need to make is that my batch file example(s) were in reply to the thread starter, bobthenob, not costi. My only response to costi was in fact made specifically to them by name and in response to their question. Link to comment Share on other sites More sharing options...
Danielb Posted March 14, 2006 Share Posted March 14, 2006 (edited) edit Edited March 14, 2006 by Danielb Link to comment Share on other sites More sharing options...
darksimoon Posted March 16, 2006 Share Posted March 16, 2006 hey yzöwl old friend you have helped to so many times.can't you make your batch file in if statement ? i mean, if D:/ partition exist move to D. if not, then leave as it is.thanks in advance Link to comment Share on other sites More sharing options...
blinkdt Posted March 17, 2006 Share Posted March 17, 2006 (edited) Here's my adaptation of Yzöwl's wonderous batch, run from Cmdlines.txt:@ECHO OFF&SETLOCAL ENABLEEXTENSIONSCOLOR 8fLABEL C: Boot-->IF NOT EXIST D: GOTO EOF<-- not working for me, any ideas?IF EXIST D:\%1 GOTO EOFFORMAT D: /FS:NTFS /V:Storage /Q /YSET DRIVE=D:SET USF=Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell FoldersSET MYDOC=%DRIVE%\%%USERNAME%%\My DocumentsSET MUSIC=%DRIVE%\%%USERNAME%%\My Documents\My MusicSET PICS=%DRIVE%\%%USERNAME%%\My Documents\My PicturesREG ADD "HKCU\%USF%" /V "My Music" /T REG_EXPAND_SZ /D "%MUSIC%" /F >NULREG ADD "HKCU\%USF%" /V "My Pictures" /T REG_EXPAND_SZ /D "%PICS%" /F >NULREG ADD "HKCU\%USF%" /V Personal /T REG_EXPAND_SZ /D "%MYDOC%" /F >NULMD "%DRIVE%\Acronis True Image Files"ENDLOCAL&GOTO :EOFIf a clean D: partition does exist, then format it, name it, move My Documents to it, and add an extra directory for backup purposes. If a D: partition does not exist or if any data resides on same, then abort the batch.<EDIT>I thought the "IF NOT EXIST" statement would work, but it fails. I partition the drive manually at the beginning of the install and create two partitions, a C: and D: The batch works fine without that line. Anyone have any ideas?</EDIT> Edited March 19, 2006 by blinkdt Link to comment Share on other sites More sharing options...
darksimoon Posted March 17, 2006 Share Posted March 17, 2006 @blinkdtthanks for your reply but in my uacd or computer D partition is data partition and there are some files. so i dont want to format it. just want to move my docs to D partition without formatting. can you correct your batch accordingly pls ? of course with "if statement" again because in my opinion this is a much more flexible situation.thanks in advance Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now