NTDrives.Exe V1.0 ----------------- Windows NT Drive Letter Remapper -------------------------------- by Reinhold J. Gerharz THE PROBLEM Windows NT (TM) 3.1 assigns drive letters to drives in a manner that is not always best for a given installation. The Disk Administrator can be used to assign letters to fixed and removable drives, but it ignores CD-ROM drives. CD-ROM drives always get their drive letters after all other drives. If you add a fixed or removable drive, the CD-ROM letter changes. If you then try to run an application that was installed before the new drive, the application can no longer find the CD-ROM drive unless you reinstall the application! (Or do some extensive editing of the System Registry.) My situation was aggravated by the fact that I must at different times attach 1 to 3 external optical drives. Furthermore, I sometimes need to transport optical media to another machine and ensure it is mapped to the same drive letter. The SUBST command is not a solution because it cannot determine which drive is the CD-ROM automatically. Also, if you are lucky enough to have the entire drive letter name-space occupied (i.e., 26 drives), SUBST will not be able to help at all! THE SOLUTION A program that automatically scans for CD-ROM and removable drives, remapping them to desired drive letter ranges is the answer. I present such a program here. It is called NTDrives.Exe, for lack of a better name that fits the 8.3 naming convention. (Name suggestions will be graciously accepted.) HOW IT WORKS NTDrives scans the drive letters that are in use and their drive mappings. It then decides how to remap CD-ROM and removable drives to satisfy the ranges specified on the command line. Finally, it performs the remapping. If any inconsistency is detected, it will not remap. If an error occurs during remapping, all remappings up to that point are undone. The worst that can happen is no remapping. (See disclaimer, below.) Error checking and recovery are the highest priority design considerations in NTDrives! Two starting ranges can be specified, the first CD-ROM letter, and the first removable drive letter. Starting with the first CD-ROM letter, all CD-ROMs are remapped, in order, to increasing drive letters. (Thus, CdRom0 gets the first letter, CdRom1 the next, etc.) Drive letters that are in use by floppies, hard drives, the LAN redirector, or the SUBST command are skipped. If an attempt is made to remap to a drive letter after Z:, the process repeats from the starting letter, going in reverse alphabetical order this time. Next, the process repeats for removable drives. This time, in addition to the drive types mentioned above, new CD-ROM drive mappings are also skipped. Thus, CD-ROMs get priority over removable drives. COMMAND LINE The command line is as follows, with optional components in brackets: NTDrives C[D-ROM]=L[:][ R[emovable]=R[:]] Spaces may be inserted as part of the parameters only if the parameter is enclosed in quotations. The command is not case-sensitive. The example attempts to remap the CD-ROMs starting at L: and removable drives starting at R:. NOTES The way I use NTDrives is to create a program icon in the Startup group that starts NTDrives.Bat. The icon displays the laser disk image from PROGMAN.EXE. In the batch file, I placed: NTDrives.Exe CD-ROM=L: Removable=R: if not errorlevel 1 subst E: L:\ Pause When I login, I need to press a key to dismiss the window, but this gives me a chance to see if there were any errors. When the removable drive is present, it "bumps" the CD-ROM from E: to F:. The SUBST command restores CD-ROM accessibility to applications installed when the removable drive was absent. The only problem with this batch file is that SUBST generates a critical error if the CD-ROM drive is empty. (Maybe I'll rewrite SUBST.) Remapping a CD-ROM over a removable drive by not also remapping removable drives removes the removable drive from visibility. Even NTDrives will not see it. To restore the removable drive, remap the CD-ROM somewhere else. If the second remap command also attempts to remap removable drives, it may need to be issued twice. Remapping removable drives over CD-ROMs may or may not duplicate this behavior. IF YOU HAVE REMOVABLE AND CD-ROM DRIVES, IT IS RECOMMENDED THEY ALL BE REMAPPED AT THE SAME TIME. Alternatively, make sure to remap only to known unused drive ranges. Specifying removable or CD-ROM drive types that are not currently installed will not have any effect. Performing several remaps and over-maps, as just described, can confuse FileManager. The F5 refresh simply won't get it right, though the command prompt seems to. The fix is to terminate and restart FileManager. The fact that FileManager can get confused leads me to suggest that NTDrives be used only once when possible. Whatever is confusing FileManager may eventually cause other problems. I also suggest spreading your remappings. The example above allows me room to expand to 9 hard disks and partitions without reinstalling CD-ROM applications or editing the System Registry. It also allows up to 6 CD-ROM drives and 9 removable drives. (I do not know how partitioned removable drives will affect NTDrives.) This maximum expansion, of course, does not allow for remote or SUBSTed drives. DISCLAIMER The Author may not be held liable for any damage caused by the use of this program. Use it at your own risk. WHAT'S IN IT FOR ME? After reading that disclaimer, you may not want to entertain the notion of compensating me for my effort, but... If you find this program useful and want to support my efforts in this area, send me five dollars. If you administer several systems and want to use this program on some or all of them, one dollar for each additional machine will suffice. If I find sufficient interest in NTDrives, I will create an auto-starting version that does its work when the system boots. Send checks to: Reinhold J. Gerharz 1601 Research Boulevard Rockville, MD 20850-3173