MSFN Forum: Reassigning drive letters automatically - MSFN Forum

Jump to content



  • 8 Pages +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

Reassigning drive letters automatically Batch to do the job Rate Topic: -----

#61 User is offline   Ben.Hahlen 

  • Member
  • PipPip
  • Group: Members
  • Posts: 112
  • Joined: 22-February 04

Posted 03 May 2005 - 05:28 PM

my mistake, never mind.


#62 User is offline   mdes 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-November 03

  Posted 04 May 2005 - 01:33 AM

Ben.Hahlen, on May 3 2005, 03:53 PM, said:

PS: I also get this error when testing:
Environment variable TMP_OLD_CDR_VOLUME- not defined
Anyone knows why?
<{POST_SNAPBACK}>
This is "normal", I will try to avoid or hide this warning on a next evolution :whistle:

#63 User is offline   webwilli 

  • Junior
  • Pip
  • Group: Members
  • Posts: 53
  • Joined: 24-October 03

Posted 16 May 2005 - 07:06 AM

i have a little problem with mapdrive.

vmware
one hdd with 4 partitions

mapdrive should give the fourth partition the Letter "L" <- this work
mapdrive must to leave the third partitions @ Letter "E" <- but mapdrive give this part the letter "Y". no DRIVE.x file at this part.

an installation without mapdrive works. E remains constant.

i made a DRIVE-.E file, but it won´t help.

what make i incorrect?

#64 User is offline   Ben.Hahlen 

  • Member
  • PipPip
  • Group: Members
  • Posts: 112
  • Joined: 22-February 04

Posted 16 May 2005 - 09:36 AM

How do I get MapDrive.cmd to run correctly from cmdlines.txt?
I currently have
"MapDrive.cmd ENU %TEMP% >%TEMP%\MapDrive.log"
this in there, but it doesn't seem to work.
What should I do to get it to run from cmdlines.txt?

#65 User is offline   mdes 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-November 03

Posted 16 May 2005 - 03:35 PM

Ben.Hahlen, on May 16 2005, 04:36 PM, said:

How do I get MapDrive.cmd to run correctly from cmdlines.txt?
I currently have
"MapDrive.cmd ENU %TEMP% >%TEMP%\MapDrive.log"
this in there,  but it doesn't seem to work.
What should I do to get it to run from cmdlines.txt?
Perhaps is %TEMP% not yet defined at this point! Try with:
"MapDrive.cmd ENU %SystemDrive%\Temp >%SystemDrive%\Temp"
(or something like this if this Temp folder does not exist) just to see if it work...

#66 User is offline   mdes 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-November 03

  Posted 16 May 2005 - 03:52 PM

webwilli, on May 16 2005, 02:06 PM, said:

i have a little problem with mapdrive.

vmware
one hdd with 4 partitions

mapdrive should give the fourth partition the Letter "L" <- this work
mapdrive must to leave the third partitions @ Letter "E" <- but mapdrive give this part the letter "Y". no DRIVE.x file at this part.

an installation without mapdrive works. E remains constant.

i made a DRIVE-.E file, but it won´t help.

what make i incorrect?
If your drive does not have to be assigned by MapDrive, MapDrive is assigning a free letter starting with Z, Y, X,... This is MY choice (the easyest to code in batch; but see below), but this could be changed by replacing the line (around 434)
FOR /F "usebackq tokens=2 delims=-=" %%L IN (`SET TMP_FREE_LETTER-`) DO SET X=%%L
by
FOR /F "usebackq tokens=2 delims=-=" %%L IN (`SET TMP_FREE_LETTER- |SORT /R`) DO SET X=%%L
but as far as I remember, this will not work in FOR loops with back quotes; so I will have to use a temporary file, and, so, replace the FOR line by the 2 following lines:
SET TMP_FREE_LETTER- |SORT /R >tempFile
FOR /F "usebackq tokens=2 delims=-=" %%L IN (tempFile) DO SET X=%%L
(Note that I did NOT test it!)

I choose to start from the end of alphabet because, when inserting an USB key (e.g.), Windows hide it sometimes under another drive; so I prefer to leave the first letters free.

#67 User is offline   Ben.Hahlen 

  • Member
  • PipPip
  • Group: Members
  • Posts: 112
  • Joined: 22-February 04

Posted 16 May 2005 - 04:53 PM

Ben.Hahlen, on May 3 2005, 03:53 PM, said:

Sorry for kicking this topic, but there's something that I would like to know.
Suppose I have a computer with a DVD+RW and a DVD-ROM. If I create a file "DVD.e" in the root of my system-drive, the program sets both the DVD+RW and the DVD-ROM to E:\.
If I create a second file "DVD.f" it sets them both to F:\.
Is there any way I can avoid this?
<{POST_SNAPBACK}>

Once more this question, since no-one answered it.
This happens also if you have Virtual Drives (that's how I tested it).
So it's basically a problem if you have two DVD or CD-drives in your computer, I think.

And mdes, your solution with %systemdrive%\temp worked :) :thumbup

EDIT: If in VMWare I set a second CD-drive, even with an image mounted, only one of them is assigned.
Would it be possible to have the CD and DVD-drives to be assigned to Z and Y or sth?

#68 User is offline   Ben.Hahlen 

  • Member
  • PipPip
  • Group: Members
  • Posts: 112
  • Joined: 22-February 04

Posted 17 May 2005 - 08:28 AM

*bump*
Anyone?

#69 User is offline   mdes 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-November 03

  Posted 17 May 2005 - 12:01 PM

I saw the problem & I'm busy to correct it :wacko:

The problem is that I didn't receive any mail when new posting arise :realmad: although I've subscribed to this topic :o So I've to look every day at this topic...

#70 User is offline   mdes 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-November 03

  Posted 18 May 2005 - 08:57 AM

Here is the new version :thumbup but I leave it in Beta status because I have only one DVD.

So test it with multiple CDR/DVD, and tell me if it is ok. When it will be correct, I will update the first post of this thread.

Thanks for your help.

ps: The modifications are the following:

Quote

Allow multiple CDR/DVD.
Suppress the "Drive not ready" message box on empty removable drives (like USB SD/CF/... card readers).
Suppress the "TMP_OLD/NEW_CDR/DVD_VOLUME- is not defined" message.
Display all the assignments (effective or not).


EDIT: The non-beta version could be downloaded on the first thread of this post.

Attached File(s)


This post has been edited by mdes: 19 May 2005 - 12:29 AM


#71 User is offline   Ben.Hahlen 

  • Member
  • PipPip
  • Group: Members
  • Posts: 112
  • Joined: 22-February 04

Posted 18 May 2005 - 11:24 AM

It seems to be working OK.
2 little messages pop up, but it doesn't influence the process:

Quote

Environment variable TMP_NEW_CDR_LETTER- not defined
Environment variable TMP_NEW_DVD_LETTER- not defined

I have no clue why this pops up...
Great to see that unspecified DVD/CD drives are automatically assigned to Z and Y :thumbup

Making a second-test run now, since it didn't work with the first try from cmdlines.txt, but that seems to be a problem from my end (corrupt download).

EDIT: Second test just ended. It works perfectly now. I think a problem will exist for people who have two DVD's or two CD's in their computer, since it will assign one to the last letter specified, and the other to Z.
But that's something that you can't fix, I think, since it's probably a limitation of the diskpart-program.
Great work though :thumbup

#72 User is offline   mdes 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-November 03

  Posted 18 May 2005 - 03:40 PM

Ben.Hahlen, on May 18 2005, 06:24 PM, said:

It seems to be working OK.
2 little messages pop up, but it doesn't influence the process:

Quote

Environment variable TMP_NEW_CDR_LETTER- not defined
Environment variable TMP_NEW_DVD_LETTER- not defined

I have no clue why this pops up...
Great to see that unspecified DVD/CD drives are automatically assigned to Z and Y :thumbup

Making a second-test run now, since it didn't work with the first try from cmdlines.txt, but that seems to be a problem from my end (corrupt download).

EDIT: Second test just ended. It works perfectly now. I think a problem will exist for people who have two DVD's or two CD's in their computer, since it will assign one to the last letter specified, and the other to Z.
But that's something that you can't fix, I think, since it's probably a limitation of the diskpart-program.
Great work though :thumbup
I may reproduce the "not defined" variables, but not yet solved... As you quoted, it is not very important :blushing:
I process CDR and DVD in separate ways, so "normaly", it will not be a problem with 2 CDR and 2 DVD :)

#73 User is offline   Ben.Hahlen 

  • Member
  • PipPip
  • Group: Members
  • Posts: 112
  • Joined: 22-February 04

Posted 18 May 2005 - 03:42 PM

mdes, on May 18 2005, 10:40 PM, said:

I process CDR and DVD in separate ways, so "normaly", it will not be a problem with 2 CDR and 2 DVD :)
<{POST_SNAPBACK}>

Erm... Explain please?

#74 User is offline   mdes 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-November 03

  Posted 18 May 2005 - 04:05 PM

Ben.Hahlen, on May 18 2005, 10:42 PM, said:

mdes, on May 18 2005, 10:40 PM, said:

I process CDR and DVD in separate ways, so "normaly", it will not be a problem with 2 CDR and 2 DVD.
<{POST_SNAPBACK}>
Erm... Explain please?
I manage only one pool of free letters.
I assign one array of variables for each CDR, and one for each DVD.
So the DVDs will be assigned Z: and Y:, and the CDRs X: and W: (if there is no DVD.x nor CDR.x on the system drive root).

Before, I didn't work with array, only a variable.

Ben.Hahlen, on May 18 2005, 06:24 PM, said:

2 little messages pop up, but it doesn't influence the process:

Quote

Environment variable TMP_NEW_CDR_LETTER- not defined
Environment variable TMP_NEW_DVD_LETTER- not defined
That's fixed :thumbup (at least, I hope)

The last version is available in the first post of this thread. Have a look at the batch file :whistle:

@Ben.Hahlen: Thanks a lot for debugging :)

#75 User is offline   deheugden 

  • Group: Members
  • Posts: 5
  • Joined: 18-May 05

Posted 23 May 2005 - 01:53 AM

Puff, this is heavy stuff. I am just doing unattend for a few days now ; trying to unattend server 2003 with a slipstreamed sp1.
But having a lot of trubbles; also with the diskpart.
i just don't know how to use it. tried reading a lot but í don't get it working.
what i would like to do is - when staring the unattend- 2 partitions are created; a c with the installation from 9 giga; and a d that should use the rest of the available memory. Both partitions should be dynamic volumes. Because i am using different sized harddisks, the d partition can be for 1 server 9 giga and for a other server 21 giga. Also, the cdrom should be given the Z
Hope someone can help me; i am stuck and totally blacked-out.

#76 User is offline   mdes 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-November 03

Posted 25 May 2005 - 03:11 PM

deheugden, on May 23 2005, 08:53 AM, said:

Puff, this is heavy stuff. I am just doing unattend for a few days now ; trying to unattend server 2003 with a slipstreamed sp1.
But having a lot of trubbles; also with the diskpart.
i just don't know how to use it. tried reading a lot but í don't get it working.
what i would like to do is - when staring the unattend- 2 partitions are created; a c with the installation from 9 giga; and a d that should use the rest of the available memory. Both partitions should be dynamic volumes. Because i am using different sized harddisks, the d partition can be for 1 server 9 giga and for a other server 21 giga. Also, the cdrom should be given the Z
Hope someone can help me; i am stuck and totally blacked-out.
I know nothing about Dynamic volumes, so I cannot help you about this point :no:

To assign the letter Z to your CDROM, just create a file names CDR.Z on the system volume (for unattended installation, you should create it in the $OEM$\$1 folder, and of course MAPDRIVE.CMD should be executed during the installation: see above for insertion in CMDLINES.TXT).

In the same way, if you create another file DRIVE.D in the root of the volume that you want to be assigned letter D, it will be assigned.

I hope this will help you partially :wacko:

#77 User is offline   Chiphead 

  • Group: Members
  • Posts: 3
  • Joined: 14-September 04

Posted 22 June 2005 - 01:40 PM

mdes, thanks for this very useful utility. :thumbup

I ran this on the machine I intend to use it for and I am having a problem.

On my C: drive I made 3 files: DRIVE.C DVD.E CDR.F
On my D: drive I made a file DRIVE.D

I also have a 2-slot Card reader which I really don't care about their letters.

I ran the command in Test mode
MapDrive ENU TEST c:\

I didn't get any errors however The CD-rom drive letter did not get reported as changed in the log file.

Here is the log file

Quote

Wed 06/22/2005 15:06:36.25

G: Volume 0     [WXHOEM_EN  ][DVD-ROM  ] [        ]   IS assignable
H: Volume 1     [NEW        ] [CD-ROM   ] [        ]   IS assignable
C: Volume 2     [[-No name-]] [Partition] [System  ]   is NOT assignable...
...because it is the System Drive
D: Volume 3     [[-No name-]] [Partition] [        ]   IS assignable
E: Volume 4     [[-No name-]] [Removeabl] [        ]   IS assignable
F: Volume 5     [[-No name-]] [Removeabl] [        ]   IS assignable
------------------------------ TMP_LISTVOL.LOG ----------
  Volume 0     G   WXHOEM_EN    CDFS   DVD-ROM      682 MB                    
  Volume 1     H   NEW          CDFS   CD-ROM        43 MB                    
  Volume 2     C                NTFS   Partition     20 GB  Healthy    System 
  Volume 3     D                NTFS   Partition     56 GB  Healthy           
  Volume 4     E                       Removeable      0 B                    
  Volume 5     F                       Removeable      0 B                    
------------------------------ TMP_REMOVE.TXT ----------
REM --- G to E [WXHOEM_EN  ] [DVD-ROM  ] [        ] Different Letter was G: ---
SELECT Volume 0 
    REMOVE NOERR

REM --- H to ? [NEW        ] [CD-ROM   ] [        ] Different Letter was H: ---
SELECT Volume 1 
    REMOVE NOERR

REM --- E to ? [[-No name-]] [Removeabl] [        ] Different Letter was E: ---
SELECT Volume 4 
    REMOVE NOERR

REM --- F to ? [[-No name-]] [Removeabl] [        ] Different Letter was F: ---
SELECT Volume 5 
    REMOVE NOERR

[TEST mode: no actual deassignment]
------------------------------ Assignments ----------
          V
Volume 2 =C --   [[-No name-]] [Partition] [System  ] System Drive
Volume 3 =D == D [[-No name-]] [Partition] [        ] Same Letter
Volume 4 =E to Y [[-No name-]] [Removeabl] [        ] Free Letter
Volume 5 =F to X [[-No name-]] [Removeabl] [        ] Free Letter
Volume 0 =G to E [WXHOEM_EN  ] [DVD-ROM  ] [        ] Different Letter
Volume 1 =H to Z [NEW        ] [CD-ROM   ] [        ] Free Letter
------------------------------
               V
Volume 2 =C --   [[-No name-]] [Partition] [System  ] System Drive
Volume 3 =D == D [[-No name-]] [Partition] [        ] Same Letter
Volume 0 =G to E [WXHOEM_EN  ] [DVD-ROM  ] [        ] Different Letter
Volume 5 =F to X [[-No name-]] [Removeabl] [        ] Free Letter
Volume 4 =E to Y [[-No name-]] [Removeabl] [        ] Free Letter
Volume 1 =H to Z [NEW        ] [CD-ROM   ] [        ] Free Letter

------------------------------ TMP_ASSIGN.TXT ----------
REM --- G to E [WXHOEM_EN  ] [DVD-ROM  ] [        ] Different Letter was G: ---
SELECT Volume 0 
    ASSIGN LETTER E NOERR

REM --- H to ? [NEW        ] [CD-ROM   ] [        ] Different Letter was H: ---
SELECT Volume 1 
    ASSIGN LETTER Z NOERR

REM --- E to ? [[-No name-]] [Removeabl] [        ] Different Letter was E: ---
SELECT Volume 4 
    ASSIGN LETTER Y NOERR

REM --- F to ? [[-No name-]] [Removeabl] [        ] Different Letter was F: ---
SELECT Volume 5 
    ASSIGN LETTER X NOERR

[TEST mode: no actual reassignment]
------------------------------ SET TMP_ ----------
TMP_CDR_NR=1
TMP_DVD_NR=1
TMP_FREE_LETTER-F=*
TMP_FREE_LETTER-G=*
TMP_FREE_LETTER-H=*
TMP_FREE_LETTER-I=*
TMP_FREE_LETTER-J=*
TMP_FREE_LETTER-K=*
TMP_FREE_LETTER-L=*
TMP_FREE_LETTER-M=*
TMP_FREE_LETTER-N=*
TMP_FREE_LETTER-O=*
TMP_FREE_LETTER-P=*
TMP_FREE_LETTER-Q=*
TMP_FREE_LETTER-R=*
TMP_FREE_LETTER-S=*
TMP_FREE_LETTER-T=*
TMP_FREE_LETTER-U=*
TMP_FREE_LETTER-V=*
TMP_FREE_LETTER-W=*
TMP_NEW_CDR_LETTER-*=?
TMP_NEW_DVD_LETTER-1-E=E
TMP_NEW_LETTER-Volume 0 =E
TMP_NEW_LETTER-Volume 1 =?
TMP_NEW_LETTER-Volume 4 =?
TMP_NEW_LETTER-Volume 5 =?
TMP_OLD_CDR_LETTER-1-Volume 1 =H
TMP_OLD_CDR_VOLUME-1-H=Volume 1
TMP_OLD_DVD_LETTER-1-Volume 0 =G
TMP_OLD_DVD_VOLUME-1-G=Volume 0
TMP_OLD_LETTER-Volume 0 =G
TMP_OLD_LETTER-Volume 1 =H
TMP_OLD_LETTER-Volume 2 =C
TMP_OLD_LETTER-Volume 3 =D
TMP_OLD_LETTER-Volume 4 =E
TMP_OLD_LETTER-Volume 5 =F
TMP_PATH=c:\
TMP_VOLDESC-Volume 0 =G to E [WXHOEM_EN  ] [DVD-ROM  ] [        ] Different Letter
TMP_VOLDESC-Volume 1 =H to Z [NEW        ] [CD-ROM   ] [        ] Free Letter
TMP_VOLDESC-Volume 2 =C --   [[-No name-]] [Partition] [System  ] System Drive
TMP_VOLDESC-Volume 3 =D == D [[-No name-]] [Partition] [        ] Same Letter
TMP_VOLDESC-Volume 4 =E to Y [[-No name-]] [Removeabl] [        ] Free Letter
TMP_VOLDESC-Volume 5 =F to X [[-No name-]] [Removeabl] [        ] Free Letter
TMP_VOLINFO-Volume 0 =       
TMP_VOLINFO-Volume 1 =       
TMP_VOLINFO-Volume 2 =System 
TMP_VOLINFO-Volume 3 =       
TMP_VOLINFO-Volume 4 =       
TMP_VOLINFO-Volume 5 =       
TMP_VOLNAME-Volume 0 =WXHOEM_EN 
TMP_VOLNAME-Volume 1 =NEW       
TMP_VOLNAME-Volume 2 =[-No name-]
TMP_VOLNAME-Volume 3 =[-No name-]
TMP_VOLNAME-Volume 4 =[-No name-]
TMP_VOLNAME-Volume 5 =[-No name-]
TMP_VOLTYPE-Volume 0 =DVD-ROM 
TMP_VOLTYPE-Volume 1 =CD-ROM  
TMP_VOLTYPE-Volume 2 =Partition
TMP_VOLTYPE-Volume 3 =Partition
TMP_VOLTYPE-Volume 4 =Removeabl
TMP_VOLTYPE-Volume 5 =Removeabl
TMP_VOLUME=Volume 1

------------------------------ NOTE ----------
TMP_VOLDESC- show the expected reassignments


Any ideas what may be happening.
I downloaded the version listed on the first post dated 5/19/05.
I saw mention of a "Beta" version. Is there a Beta version I should be using?

Just for the heck of it I tried excluding the letters 'I' through 'Z' to see how it would assign the letters. It STILL "assigned" (log-file) X-Y-Z to the CD-Rom and the two Card reader slots?

I made files name DRIVE-.I , Drive-.J, etc. and put them at the root of C:\ (system Drive) and it looks like they weren't even acknowledged by the batch file.
I've attached the file.


Thanks in advance,

Attached File(s)


This post has been edited by Chiphead: 22 June 2005 - 02:00 PM


#78 User is offline   mdes 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-November 03

  Posted 23 June 2005 - 12:30 AM

Chiphead, on Jun 22 2005, 08:40 PM, said:

I didn't get any errors however The CD-rom drive letter did not get reported as changed in the log file.
Hi Chiphead,

I found the problem :blushing:
Here is a new version (I didn't test it :o , but I will do it in a few hours): try it and, please, report here any success, or any failure.

ps1: The "beta" version in this post is no more a beta, but I forgot to update the one in the first post of this thread :blushing: So, for anyone, take the beta one... As soon as the bug described here will be corrected, I will update the 1st post.

ps2: Instead of using the QUOTE tag, use the CODE one, so the files will be beautifully displayed :P

EDIT 2005/07/20: Attachment deleted, see first post for the last version.

This post has been edited by mdes: 20 July 2005 - 10:44 AM


#79 User is offline   Chiphead 

  • Group: Members
  • Posts: 3
  • Joined: 14-September 04

Posted 23 June 2005 - 03:06 PM

CD-Rom Drive problem.....FIXED! :thumbup

Still have one other problem, the drive letter exclusions don't seem to have any effect.

As I mentioned in my previous post I made the drive exclusion files as instructed:
DRIVE-.I through DRIVE-.Z and put them on the root of the system drive (C:) in an attempt to force the Removeable drives to take the letters G & H. It is not working still.

Also, I call the MapDrive.cmd file using a start /wait from my RunOnceEX.cmd file and the MapDrive.cmd doesn't seem to contain an appropriately placed EXIT command so the cmd Window Titled "ReAssign letters to Drives" remains open and my RunOnceEx.cmd file will not continue until I close the "ReAssign letters to Drives" window.
The reason for the start /wait is because I am relying on accurate Drive Letters for the CDROM variable in my RunOnceEX.cmd file to work. Since the script takes a little time to finish I have to "Start /WAIT" launch the file.

I placed two EXIT commands in the file here:

:: -------------------------------------------------------------------------------
:: Display some "debug" infos
:: -------------------------------------------------------------------------------

ECHO ------------------------------ SET TMP_ ---------- >>TMP_MAPDRIVE.LOG
SET TMP_ | SORT  | MORE >>TMP_MAPDRIVE.LOG
ECHO ------------------------------ NOTE ---------- >>TMP_MAPDRIVE.LOG
ECHO TMP_VOLDESC- show the expected reassignments >>TMP_MAPDRIVE.LOG
EXIT
GOTO :EOF

:: -------------------------------------------------------------------------------
:MakeDesc "VolNr" "OldLetter" "NewLetter" "VolName" "VolType" "VolInfo" "Comment" "DestVariable"
::         1       2           3           4         5         6         7         8
:: -------------------------------------------------------------------------------
SET To=to
IF "%~3" == " " SET To=--
IF "%~3" == "  " SET To=%~1
IF "%~2" == "%~3" SET To===

SET %~8=%~2 %To% %~3 [%~4] [%~5] [%~6] %~7
GOTO :EOF
EXIT
------This is the end of the file -----


It seems to work perfectly when I use it. Are these EXITs located in an appropriate place?

PS: I have not yet added them into the NEW version.

Here are the Log File Results (using the Code Tags as suggested :D )
MAPDRIVE v2005/06/23 
 
E: Volume 0     [[-No name-]] [DVD-ROM  ] [        ]   IS assignable 
Z: Volume 1     [[-No name-]] [CD-ROM   ] [        ]   IS assignable 
C: Volume 2     [[-No name-]] [Partition] [System  ]   is NOT assignable... 
...because it is the System Drive 
D: Volume 3     [[-No name-]] [Partition] [        ]   IS assignable 
Y: Volume 4     [[-No name-]] [Removeabl] [        ]   IS assignable 
X: Volume 5     [[-No name-]] [Removeabl] [        ]   IS assignable 
------------------------------ TMP_LISTVOL.LOG ---------- 
  Volume 0     E                       DVD-ROM         0 B                     
  Volume 1     Z                       CD-ROM          0 B                     
  Volume 2     C                NTFS   Partition     20 GB  Healthy    System  
  Volume 3     D                NTFS   Partition     56 GB  Healthy            
  Volume 4     Y                       Removeable      0 B                     
  Volume 5     X                       Removeable      0 B                     
------------------------------ TMP_REMOVE.TXT ---------- 
REM --- Z to F [[-No name-]] [CD-ROM   ] [        ] Different Letter was Z: --- 
SELECT Volume 1  
    REMOVE NOERR 
 
REM --- Y to ? [[-No name-]] [Removeabl] [        ] Different Letter was Y: --- 
SELECT Volume 4  
    REMOVE NOERR 
 
REM --- X to ? [[-No name-]] [Removeabl] [        ] Different Letter was X: --- 
SELECT Volume 5  
    REMOVE NOERR 
 
[TEST mode: no actual deassignment] 
------------------------------ Assignments ---------- 
          V 
Volume 2 =C --   [[-No name-]] [Partition] [System  ] System Drive 
Volume 3 =D == D [[-No name-]] [Partition] [        ] Same Letter 
Volume 0 =E == E [[-No name-]] [DVD-ROM  ] [        ] Same Letter 
Volume 5 =X to Y [[-No name-]] [Removeabl] [        ] Free Letter 
Volume 4 =Y to Z [[-No name-]] [Removeabl] [        ] Free Letter 
Volume 1 =Z to F [[-No name-]] [CD-ROM   ] [        ] Different Letter 
------------------------------ 
               V 
Volume 2 =C --   [[-No name-]] [Partition] [System  ] System Drive 
Volume 3 =D == D [[-No name-]] [Partition] [        ] Same Letter 
Volume 0 =E == E [[-No name-]] [DVD-ROM  ] [        ] Same Letter 
Volume 1 =Z to F [[-No name-]] [CD-ROM   ] [        ] Different Letter 
Volume 5 =X to Y [[-No name-]] [Removeabl] [        ] Free Letter 
Volume 4 =Y to Z [[-No name-]] [Removeabl] [        ] Free Letter 
 
------------------------------ TMP_ASSIGN.TXT ---------- 
REM --- Z to F [[-No name-]] [CD-ROM   ] [        ] Different Letter was Z: --- 
SELECT Volume 1  
    ASSIGN LETTER F NOERR 
 
REM --- Y to ? [[-No name-]] [Removeabl] [        ] Different Letter was Y: --- 
SELECT Volume 4  
    ASSIGN LETTER Z NOERR 
 
REM --- X to ? [[-No name-]] [Removeabl] [        ] Different Letter was X: --- 
SELECT Volume 5  
    ASSIGN LETTER Y NOERR 
 
[TEST mode: no actual reassignment] 
------------------------------ SET TMP_ ---------- 
TMP_CDR_NR=1
TMP_DVD_NR=1
TMP_FREE_LETTER-G=*
TMP_FREE_LETTER-H=*
TMP_FREE_LETTER-I=*
TMP_FREE_LETTER-J=*
TMP_FREE_LETTER-K=*
TMP_FREE_LETTER-L=*
TMP_FREE_LETTER-M=*
TMP_FREE_LETTER-N=*
TMP_FREE_LETTER-O=*
TMP_FREE_LETTER-P=*
TMP_FREE_LETTER-Q=*
TMP_FREE_LETTER-R=*
TMP_FREE_LETTER-S=*
TMP_FREE_LETTER-T=*
TMP_FREE_LETTER-U=*
TMP_FREE_LETTER-V=*
TMP_FREE_LETTER-W=*
TMP_FREE_LETTER-X=*
TMP_NEW_CDR_LETTER-1-F=F
TMP_NEW_DVD_LETTER-1-E=E
TMP_NEW_LETTER-Volume 1 =F
TMP_NEW_LETTER-Volume 4 =?
TMP_NEW_LETTER-Volume 5 =?
TMP_NR=1
TMP_OLD_CDR_LETTER-1-Volume 1 =Z
TMP_OLD_CDR_VOLUME-1-Z=Volume 1 
TMP_OLD_DVD_LETTER-1-Volume 0 =E
TMP_OLD_DVD_VOLUME-1-E=Volume 0 
TMP_OLD_LETTER-Volume 0 =E
TMP_OLD_LETTER-Volume 1 =Z
TMP_OLD_LETTER-Volume 2 =C
TMP_OLD_LETTER-Volume 3 =D
TMP_OLD_LETTER-Volume 4 =Y
TMP_OLD_LETTER-Volume 5 =X
TMP_PATH=C:\Install\
TMP_VOLDESC-Volume 0 =E == E [[-No name-]] [DVD-ROM  ] [        ] Same Letter
TMP_VOLDESC-Volume 1 =Z to F [[-No name-]] [CD-ROM   ] [        ] Different Letter
TMP_VOLDESC-Volume 2 =C --   [[-No name-]] [Partition] [System  ] System Drive
TMP_VOLDESC-Volume 3 =D == D [[-No name-]] [Partition] [        ] Same Letter
TMP_VOLDESC-Volume 4 =Y to Z [[-No name-]] [Removeabl] [        ] Free Letter
TMP_VOLDESC-Volume 5 =X to Y [[-No name-]] [Removeabl] [        ] Free Letter
TMP_VOLINFO-Volume 0 =        
TMP_VOLINFO-Volume 1 =        
TMP_VOLINFO-Volume 2 =System  
TMP_VOLINFO-Volume 3 =        
TMP_VOLINFO-Volume 4 =        
TMP_VOLINFO-Volume 5 =        
TMP_VOLNAME-Volume 0 =[-No name-]
TMP_VOLNAME-Volume 1 =[-No name-]
TMP_VOLNAME-Volume 2 =[-No name-]
TMP_VOLNAME-Volume 3 =[-No name-]
TMP_VOLNAME-Volume 4 =[-No name-]
TMP_VOLNAME-Volume 5 =[-No name-]
TMP_VOLTYPE-Volume 0 =DVD-ROM  
TMP_VOLTYPE-Volume 1 =CD-ROM   
TMP_VOLTYPE-Volume 2 =Partition
TMP_VOLTYPE-Volume 3 =Partition
TMP_VOLTYPE-Volume 4 =Removeabl
TMP_VOLTYPE-Volume 5 =Removeabl
TMP_VOLUME=Volume 1 

------------------------------ NOTE ---------- 
TMP_VOLDESC- show the expected reassignments


Thanks again,

#80 User is offline   mdes 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 343
  • Joined: 07-November 03

  Posted 24 June 2005 - 07:18 AM

Chiphead, on Jun 23 2005, 10:06 PM, said:

CD-Rom Drive problem.....FIXED!  :thumbup
I have only a DVD writer, so, I could not really test it :( But I am very happy of your help.

Chiphead, on Jun 23 2005, 10:06 PM, said:

Still have one other problem,  the drive letter exclusions don't seem to have any effect.

As I mentioned in my previous post I made the drive exclusion files as instructed:
DRIVE-.I  through DRIVE-.Z and put them on the root of the system drive (C:) in an attempt to force the Removeable drives to take the letters G & H.  It is not working still.
Could you change one line in the batch file as (marked with a leading "=>")?
           REM -------------------------------------------------------------------------------
            REM On System Drive, the files DRIVE-.? indicate letters not to be assigned
            REM -------------------------------------------------------------------------------
=>         FOR %%U IN (!TMP_OLD_LETTER!:\DRIVE-.?) DO (
                SET TMP_NOT_FREE=%%~xU
                SET TMP_FREE_LETTER-!TMP_NOT_FREE:~1!=
            )
and tell me if the problem is solved? (In any case, I can reproduce this bug on my system)

Chiphead, on Jun 23 2005, 10:06 PM, said:

Also, I call the MapDrive.cmd file using a start /wait from my RunOnceEX.cmd file and the MapDrive.cmd doesn't seem to contain an appropriately placed EXIT command so the cmd Window Titled "ReAssign letters to Drives" remains open and my RunOnceEx.cmd file will not continue until I close the "ReAssign letters to Drives" window.
The reason for the start /wait is because I am relying on accurate Drive Letters for the CDROM variable in my RunOnceEX.cmd file to work.  Since the script takes a little time to finish I have to "Start /WAIT" launch the file.

I placed two EXIT commands in the file here:

...
EXIT
GOTO :EOF
...
GOTO :EOF
EXIT
It seems to work perfectly when I use it.  Are these EXITs located in an appropriate place?
EXIT has the same effect as GOTO :EOF, so I cannot see why it should work with these 2 EXIT added ??? Type GOTO /? and/or CALL /? in a command box for a description of the GOTO :EOF extension that will allow you to "return" from a batch script

Thank for your help for debugging :yes:

Share this topic:


  • 8 Pages +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 6
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy