bwbarbieri
June 10th, 2001, 07:31 AM
PRELIMINARY
-----------
Mosaic1: Do you mean the post regarding changing the NOTEPAD default directory? Seems like other people have a similar requirement to mine. Maybe this post will help.
The final result is about as simple as I know how to get it. I think the regD/E files might be made shorter. My understanding of the registry is.... make a change in one handle key and the "other" is automatically changed. I don't remember which ones are connected, so I've yet to check into this improvement.
FINAL STEPS
-----------
Here's the happily-ever-after ending to this story. I think anything past this would be refinement -- for example, making it work in a more general fashion for any PC. The end result works perfectly, is PC specific (see details below) and now works completely in the background during bootup.
The following lines are added to Autoexec.bat:
vol D: |find /i "drive" > out.bat
echo set volab=%%5> volume.bat
call out.bat
del out.bat
del volume.bat
if %volab%==IMAGES goto dline
regedit.exe regE.reg
goto end
:dline
regedit.exe regD.reg
:end
set volab=
Also, the files regD.reg and regE.reg need to be in the DOS path (for example, both of mine are in C directory).
DETAILS
--------
The first and sixth lines are specific to my PC. However, this file can be adapted to anyone's particular setup.
The first line specifies the D: drive (actually partition in my case) as the place from which to extract the volume label. This is because I keep my Favorites folder (moved using TweakUI) on the IMAGES partition. When I boot, either this partition or my removable drive ends up being labeled as "D:" by System Commander.
When I have the removable drive tray out, IMAGES is D. When the drive tray is in, the removable drive (whatever that is, regardless of volume label on the disk it holds) is D. Hence, line 6. The 6-th line is where the volume label of the D drive is tested. If it is "IMAGES", then regD.reg is imported into the registry in real DOS mode (hence, no confirmation messages!). The registry file regD.reg changes ALL Windows registry entries necessary to ensure Windows points all "Favorites activities" to the current D drive/partition.
If the label on D is NOT "IMAGES" (therefore, the removable tray is in), then regE.reg is imported. This registry file points Windows to the E-drive/partition, because IMAGES becomes the E drive when the tray is in.
Hope this is clear enough. The only other thing anyone needs in order to use this fix for their own PC are the registry files to import. I'm giving the regD.reg file here. (NOTE: The "{" and "}" indicate the beginning and end of the file. They are NOT to be included in the file. WARNING: The carriage return at the end of the file is REQUIRED!!! The last registry entry will not be imported without it. There is no guarantee that these particular registry entries are compatible with any PC other than my own. If you want to use this fix, review your particular registry entries, and create your own file if necessary.)
{REGEDIT4
[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"Favorites"="D:\\Favorites"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"Favorites"="D:\\Favorites"
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\explorer\User Shell Folders]
"Favorites"="D:\\Favorites"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"Favorites"=hex(2):44,3a,5c,46,61,76,6f,72,69,74,65,73,00
[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders]
"Favorites"=hex(2):44,3a,5c,46,61,76,6f,72,69,74,65,73,00
[HKEY_CURRENT_USER\Software\Microsoft\Advanced INF Setup\IE UserData\RegBackup\0]
"84569d41a3ab9004"=hex:2c,53,4f,46,54,57,41,52,45,5c,4d,69,63,72,6f,73,6f,66,\
74,5c,57,69,6e,64,6f,77,73,5c,43,75,72,72,65,6e,74,56,65,72,73,69,6f,6e,5c,\
45,78,70,6c,6f,72,65,72,5c,53,68,65,6c,6c,20,46,6f,6c,64,65,72,73,2c,46,61,\
76,6f,72,69,74,65,73,2c,00,01,00,00,00,15,00,00,00,44,3a,5c,46,61,76,6f,72,\
69,74,65,73,00
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Toolbar\ShellBrowser]
"{0E5CBF21-D15F-11D0-8301-00AA005B4383}"=hex:21,bf,5c,0e,5f,d1,d0,11,83,01,00,\
aa,00,5b,43,83,22,00,1c,00,08,00,00,00,06,00,00,00,01,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,4c,00,00,00,01,14,02,00,00,00,00,00,c0,00,00,00,00,\
00,00,46,03,00,00,00,10,00,00,00,20,f3,e0,a4,8b,f0,c0,01,00,e0,f3,7c,cf,ef,\
c0,01,00,ab,d9,a5,8b,f0,c0,01,00,00,00,00,00,00,00,00,01,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,6a,00,14,00,1f,0f,e0,4f,d0,20,ea,3a,69,10,a2,d8,\
08,00,2b,30,30,9d,19,00,23,45,3a,5c,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,e9,05,21,00,31,00,00,00,00,00,c9,2a,41,13,10,00,46,61,76,6f,72,\
69,74,65,73,00,46,41,56,4f,52,49,7e,31,00,1a,00,31,00,00,00,00,00,c9,2a,5b,\
13,10,00,4c,69,6e,6b,73,00,4c,49,4e,4b,53,00,00,00,48,00,00,00,1c,00,00,00,\
01,00,00,00,1c,00,00,00,34,00,00,00,00,00,00,00,47,00,00,00,18,00,00,00,03,\
00,00,00,b2,bd,b1,bd,10,00,00,00,53,54,4f,52,41,47,45,00,44,3a,5c,46,61,76,\
6f,72,69,74,65,73,5c,4c,69,6e,6b,73,00,00,10,00,00,00,05,00,00,a0,06,00,00,\
00,4e,00,00,00,00,00,00,00
}
The regE.reg file can be constructed from this by changing every reference to the D drive to E. How to do this correctly is obvious for the first three entries. The last four require interpreting the hex values. The safest way to locate the exact position on your PC might be to enter the registry and view the interpretation of the binary value by right-clicking on the particular entry and selecting modify. Look in the right-most column for what the numbers actually mean.
In my example, values in the fourth and fifth registry entries in the regD.reg file need the first number (44 in my example) changed. "D" is 44. "E" would be 45.
In my example, the last two registry entries require the first "44" found from the end of the string to be changed (each has a "3a" - representing the colon[:] to its right). Again, "D" is 44 and "E" is 45.
My thanks to everyone for their help, especially Mosaic1 who followed through the whole process without giving up so easily!
Have fun http://discussions.virtualdr.com/smile.gif
BWBarbieri
[This message has been edited by bwbarbieri (edited 06-10-2001).]
[This message has been edited by bwbarbieri (edited 06-10-2001).]
[This message has been edited by bwbarbieri (edited 06-10-2001).]