Jump to content

Reassigning drive letters automatically


Recommended Posts


  • 2 weeks later...

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

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?

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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:

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.

MapDrive.cmd

Edited by mdes
Link to comment
Share on other sites

It seems to be working OK.

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

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

Link to comment
Share on other sites

It seems to be working OK.

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

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 :)

Link to comment
Share on other sites

I process CDR and DVD in separate ways, so "normaly", it will not be a problem with 2 CDR and 2 DVD.

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.

2 little messages pop up, but it doesn't influence the process:
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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...