Jump to content

Reassigning drive letters automatically


Recommended Posts


  • 2 weeks later...

Its' not working at all for me. Here's what drives I have (from disk management) and how the letters get reassigned:

Disk0	 C:  ->  C:
Disk1 D: -> X:
E: -> none
CDrom0 W: -> Z: (DVD rewriter)
CDrom1 V: -> Y: (Daemon Tools virt drive)

The only thing that needs to change is E: to K:

TMP_MAPDRIVE_22_10_2005_19_56_40.LOG.txt

Edited by tinnef
Link to comment
Share on other sites

Hi Tinnef,

You should put the files DRIVE.x on the drives y if you want the drive y to be reassign to x.

So, to reassign the drive E: to K:, you should create a file DRIVE.K in E:\

But, I see there is still an error in my script :( because of the "E: -> none" : I will correct it in a few hours. Could you send me the .log file after running MAPDRIVE.CMD with TEST as the 2d parameter to help me debugging.

Thanks.

Edited by mdes
Link to comment
Share on other sites

So, to reassign the drive E: to K:, you should create a file DRIVE.K in E:\

But, I see there is still an error in my script :( because of the "E: -> none" : I will correct it in a few hours. Could you send me the .log file after running MAPDRIVE.CMD with TEST as the 2d parameter to help me debugging.

Thanks.

That's what I have. But even so, I definetely don't have any DVD.Y or Z files anywhere or a DRIVE.X on D.

I'll double check all the files and run the test this evening.

Link to comment
Share on other sites

Unfortunately that was only part of the problem.

E: gets reassigned correctly now, but it is still also changing D:,V: and W: although there are no other DRIVE.? DVD.? files

Edit:

I just thought I'd check if Daemon-tools caused problems, but after disabling it the same thing happens

TMP_MAPDRIVE_24_10_2005_18_57_53.LOG.txt

Edited by tinnef
Link to comment
Share on other sites

If there are no DVD.? on the system drive, then MAPDRIVE reassigns free letters to the DVD (same for CDR and HDD).

In fact, currently, MAPDRIVE is assigning free letters (starting from the alphabet end) to drives that are not forced to be assigned a specific letter (via DRIVE.?, DVD.? and CDR.?). But you gave me a good idea: why do I reassign this kind of free letters instead of leaving the current letter if this one is not forced to be used?

I will try to modify MAPDRIVE to do in such a way :)

Edited by mdes
Link to comment
Share on other sites

Then I misunderstood how it works, but the change would be great. So for now a DRIVE.D file on the D: drive etc should solve my problem?

By the way, I don't think the script checks if an optical drive is a writer or not. I have a script which does that. It's a bit quick and dirty (well more dirty than quick), and quite limited, but it pretty much works. I attached it, feel free adapt it and include in MAPDRIVE, because I've reached the limit of my batcj scripting skills with this.

I run it from guirunonce. In an earlier stage I run detectcd (I thin from Icemannd), which writes any CD letters as an environment variable to the registry, then use this to run the script

for %%I in (%CDROM1% %CDROM2%) do call %systemdrive%\install\scripts\cd.cmd %%I

cd.cmd.txt

Link to comment
Share on other sites

All informations are in

HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices
and all the characteristics of each drive is in the "readable" binary data "\DosDevices\...". But I would prefer to rewrite MAPDRIVE.CMD in a .VBS one to interpret them ;) It's probably Unicode...
Link to comment
Share on other sites

New version (2005/10/28):

  • DRIVE.?, DVD.? and CDR.? could be hidden.
  • Try to keep the existing letters.
  • Group deasignments and reassignments.

See the first post of this thread to download it.

Link to comment
Share on other sites

Hi mdes.... drscouse.. again!!!

My first attempt at using mapdrive on an unattended install, failed.... at which point it suddenly dawned on me why...

I am trying to run it of an Unattended XP CD I am creating... this would not work, as none of the files created by mapdrive in its execution, could be created on the disk!!

I am trying to run it from cmdlines.txt which executes at the t-12 installation point during setup, and am assuming this is being read from CD, rather than first being copied to the HD?

I know I could run mapdrive from the HD, from the CD... but I would prefer to incorporate it onto the disk... is it therefore possible to set a temp dir on the installation directory for mapdrive to use, and allow it to run from cd?

Thanks

EDIT: Actually, I think it would be easier if I changed the location of the .cmd so that it would be copied to the root of the installation dir.

EDIT: Runs fine from runoncex... works very well indeed!!!!

Edited by drscouse
Link to comment
Share on other sites

Hi mdes.... drscouse.. again!!!
You're welcome :yes:
is it therefore possible to set a temp dir on the installation directory for mapdrive to use, and allow it to run from cd?
Yes, as stated in the documentation which is at the .CMD beginning:
:: Parameters:
:: ----------
:: 1. Language ID (ENU, FRA, DEU,...). No default value, mandatory.
:: 2. TEST to do everything except the drives de/re-assignment. The log file
:: TMP_MAPDRIVE_date_time.LOG is created: you can display it to see the expected assignments.
:: The environment variables TMP_VOLDESC- show the assignments to be done.
:: 3. TempPath : Path where temporary files will be created. Default is current directory.
:: Path could be enclosed in quotes and could terminated by a backslsh.
:: This is the 2d parameter if the TEST is omitted as the 2d one.

You can use %SYSTEMDRIVE%:\...

ps: I jut downloaded a new version in the 1st post.

Edited by mdes
Link to comment
Share on other sites

Hi mdes.... drscouse.. again!!!

ps: I jut downloaded a new version in the 1st post.

Hi mdes !

A new "mapdrive" great ! :thumbup

What's new ?

Longue vie à Mdes, à Mapdrive et à la France

ps: there is no download link on your frist post :}

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