home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / WIN_NT / NTDR10.ZIP / NTDRIVES.TXT < prev   
Text File  |  1994-01-31  |  7KB  |  135 lines

  1.                                NTDrives.Exe V1.0
  2.                                -----------------
  3.                                        
  4.                        Windows NT Drive Letter Remapper
  5.                        --------------------------------
  6.                                        
  7.                             by Reinhold J. Gerharz
  8.                                        
  9. THE PROBLEM
  10.  
  11. Windows  NT  (TM) 3.1 assigns drive letters to drives in a manner that  is  not
  12. always  best for a given installation. The Disk Administrator can  be  used  to
  13. assign  letters  to fixed and removable drives, but it ignores  CD-ROM  drives.
  14. CD-ROM drives always get their drive letters after all other drives. If you add
  15. a  fixed or removable drive, the CD-ROM letter changes. If you then try to  run
  16. an  application that was installed before the new drive, the application can no
  17. longer find the CD-ROM drive unless you reinstall the application! (Or do  some
  18. extensive editing of the System Registry.)
  19.  
  20. My situation was aggravated by the fact that I must at different times attach 1
  21. to  3  external  optical  drives. Furthermore, I sometimes  need  to  transport
  22. optical  media  to another machine and ensure it is mapped to  the  same  drive
  23. letter.
  24.  
  25. The SUBST command is not a solution because it cannot determine which drive  is
  26. the  CD-ROM  automatically. Also, if you are lucky enough to  have  the  entire
  27. drive  letter name-space occupied (i.e., 26 drives), SUBST will not be able  to
  28. help at all!
  29.  
  30. THE SOLUTION
  31.  
  32. A  program  that automatically scans for CD-ROM and removable drives, remapping
  33. them  to  desired drive letter ranges is the answer. I present such  a  program
  34. here.  It is called NTDrives.Exe, for lack of a better name that fits  the  8.3
  35. naming convention. (Name suggestions will be graciously accepted.)
  36.  
  37. HOW IT WORKS
  38.  
  39. NTDrives  scans the drive letters that are in use and their drive mappings.  It
  40. then  decides  how to remap CD-ROM and removable drives to satisfy  the  ranges
  41. specified  on  the  command line. Finally, it performs the  remapping.  If  any
  42. inconsistency  is  detected,  it will not remap.  If  an  error  occurs  during
  43. remapping,  all  remappings up to that point are undone.  The  worst  that  can
  44. happen  is  no remapping. (See disclaimer, below.) Error checking and  recovery
  45. are the highest priority design considerations in NTDrives!
  46.  
  47. Two  starting ranges can be specified, the first CD-ROM letter, and  the  first
  48. removable drive letter. Starting with the first CD-ROM letter, all CD-ROMs  are
  49. remapped,  in order, to increasing drive letters. (Thus, CdRom0 gets the  first
  50. letter, CdRom1 the next, etc.) Drive letters that are in use by floppies,  hard
  51. drives, the LAN redirector, or the SUBST command are skipped. If an attempt  is
  52. made to remap to a drive letter after Z:, the process repeats from the starting
  53. letter, going in reverse alphabetical order this time.
  54.  
  55. Next,  the process repeats for removable drives. This time, in addition to  the
  56. drive  types mentioned above, new CD-ROM drive mappings are also skipped. Thus,
  57. CD-ROMs get priority over removable drives.
  58.  
  59. COMMAND LINE
  60.  
  61. The command line is as follows, with optional components in brackets:
  62.  
  63.           NTDrives C[D-ROM]=L[:][ R[emovable]=R[:]]
  64.  
  65. Spaces  may  be  inserted as part of the parameters only if  the  parameter  is
  66. enclosed in quotations. The command is not case-sensitive. The example attempts
  67. to remap the CD-ROMs starting at L: and removable drives starting at R:.
  68.  
  69. NOTES
  70.  
  71. The  way  I use NTDrives is to create a program icon in the Startup group  that
  72. starts  NTDrives.Bat. The icon displays the laser disk image from  PROGMAN.EXE.
  73. In the batch file, I placed:
  74.  
  75.           NTDrives.Exe CD-ROM=L: Removable=R:
  76.           if not errorlevel 1 subst E: L:\
  77.           Pause
  78.  
  79. When I login, I need to press a key to dismiss the window, but this gives me  a
  80. chance to see if there were any errors. When the removable drive is present, it
  81. "bumps"  the  CD-ROM  from  E:  to  F:.  The  SUBST  command  restores   CD-ROM
  82. accessibility  to applications installed when the removable drive  was  absent.
  83. The  only problem with this batch file is that SUBST generates a critical error
  84. if the CD-ROM drive is empty. (Maybe I'll rewrite SUBST.)
  85.  
  86. Remapping  a  CD-ROM  over  a removable drive by not also  remapping  removable
  87. drives removes the removable drive from visibility. Even NTDrives will not  see
  88. it.  To  restore the removable drive, remap the CD-ROM somewhere else.  If  the
  89. second remap command also attempts to remap removable drives, it may need to be
  90. issued  twice. Remapping removable drives over CD-ROMs may or may not duplicate
  91. this  behavior. IF YOU HAVE REMOVABLE AND CD-ROM DRIVES, IT IS RECOMMENDED THEY
  92. ALL  BE  REMAPPED AT THE SAME TIME. Alternatively, make sure to remap  only  to
  93. known unused drive ranges. Specifying removable or CD-ROM drive types that  are
  94. not currently installed will not have any effect.
  95.  
  96. Performing  several  remaps  and  over-maps, as  just  described,  can  confuse
  97. FileManager.  The  F5  refresh simply won't get it right,  though  the  command
  98. prompt seems to. The fix is to terminate and restart FileManager.
  99.  
  100. The fact that FileManager can get confused leads me to suggest that NTDrives be
  101. used  only once when possible. Whatever is confusing FileManager may eventually
  102. cause other problems.
  103.  
  104. I  also suggest spreading your remappings. The example above allows me room  to
  105. expand  to 9 hard disks and partitions without reinstalling CD-ROM applications
  106. or  editing  the System Registry. It also allows up to 6 CD-ROM  drives  and  9
  107. removable  drives. (I do not know how partitioned removable drives will  affect
  108. NTDrives.)  This  maximum expansion, of course, does not allow  for  remote  or
  109. SUBSTed drives.
  110.  
  111. DISCLAIMER
  112.  
  113. The  Author  may not be held liable for any damage caused by the  use  of  this
  114. program. Use it at your own risk.
  115.  
  116. WHAT'S IN IT FOR ME?
  117.  
  118. After  reading  that disclaimer, you may not want to entertain  the  notion  of
  119. compensating me for my effort, but...
  120.  
  121. If  you  find this program useful and want to support my efforts in this  area,
  122. send  me  five dollars. If you administer several systems and want to use  this
  123. program  on  some or all of them, one dollar for each additional  machine  will
  124. suffice.
  125.  
  126. If  I  find  sufficient  interest in NTDrives, I will create  an  auto-starting
  127. version that does its work when the system boots.
  128.  
  129. Send checks to:
  130.  
  131.           Reinhold J. Gerharz
  132.           1601 Research Boulevard
  133.           Rockville, MD 20850-3173
  134.           
  135.