Jump to content

Reassigning drive letters automatically


Recommended Posts


No problem (I thought you were being sarcastic at first) :)

but anyway yep come to think about it i do have a question!

From my previous post:

I'm trying to accomplish this on a dual boot (xp/2K) machine :rolleyes:

(2 C:'s (each hidden from each other), 2 D:'s, and 1 E:)

Ok MapDrive.cmd worked half right...

This was my layout beforehand: (all on a single disk)

P=Partiton

P1: C:WINXP

P2: C:WIN2K

P3: D:WINXP.PROGRAMS

P4: D:WIN2K.PROGRAMS

P5: E:STORAGE

Again, both C's were hidden from each other via bootmanager

both D's were hidden from each other via

Administrative Tools>Computer Management->Disk Management

Now after running Mapdrive on an Unattended XP Install..

The Drive Leters turn out like this (under XP)

P1: C:WINXP

P3: D:WINXP.PROGRAMS <-perfect

P4: E:2K.PROGRAMS

P5 F:STORAGE

So P2: C:WIN2K is still hidden in Windows Explorer = perfect.

P3: D:\WINXP.PROGRAMS is exactly where i want it = perfect

but P3: is visible which in turn messes up where i want "Documents and Settings" to be (Mapped to P5) with the drive letter E:

Now i put all the DRIVE.x (x=drive letter) in each respective partition i want it to be (to XP):

P1: DRIVE.c

P2: DRIVE.g

P3: DRIVE.d

P4: DRIVE.f

P5: DRIVE.e

And i don't think swapping the DRIVE.g file with DRIVE.f file will accomplish anything because P2: is obviously still hidden. So theoretically it should have worked perfectly but...

Anyway i normally hide the additional partitions via Disk Management

so would there be a reg key to hide the additional ones or

any other ideas? workarounds? fixes? :D

I really need a fix for this..because doing it this way was the original reason i investigated this unnattended install method. I read that it was the best/most reliable way to remap Program Files and the Profile & Settings Dirs. Not to mention the fact that i have carpal tunnel syndrome/rsi and have to stop doing so much computer work. Even though that's what i do for a living. (All more the reason). :D

Link to comment
Share on other sites

but P3: is visible
I suppose it is P4, anot P3.
P1: DRIVE.c

P2: DRIVE.g

P3: DRIVE.d

P4: DRIVE.f

P5: DRIVE.e

And i don't think swapping the DRIVE.g file with DRIVE.f file will accomplish anything because P2: is obviously still hidden. So theoretically it should have worked perfectly but...

But what ???

Microsoft said that an "ASSIGN LETTER" (without letter) given to DISKPART will assign the next free letter to the SELECTed VOLUME: this seems to be a bug because an error is given. So, if you want to hide volume (partition), you should execute the following command before MapDrive.cmd:

DISKPART /s file.txt

with file.txt containing

SELECT VOLUME i (for your WinXP, "i" should correspond to P4 as seen with LIST VOLUME)

REMOVE

So, no letter will be assigned to the volume which doesnot have a letter.

If the above does not work, for WinXP you should do:

\$OEM$\C\DRIVE.C (for P1)

\$OEM$\D\DRIVE.D (for P3)

\$OEM$\E\DRIVE.F (for P4)

\$OEM$\F\DRIVE.E (for P5)

and for Win2K:

\$OEM$\C\DRIVE.C (for P2)

\$OEM$\D\DRIVE.F (for P3)

\$OEM$\E\DRIVE.D (for P4)

\$OEM$\F\DRIVE.E (for P5)

Edited by mdes
Link to comment
Share on other sites

  • 1 month later...
I have my drives set up this way...

C: windows

d: data

f: free

e: A^2

h:

t: temp (temp files)

p: programs

s: swap

I: (pen drive)

k: (dvd)

L: (CD)

Create the following (empty) files (right click, choose New/Text document, and rename it): (I am assuming that your system drive is C:)

C:\DVD.K

C:\CDR.L

D:\DRIVE.D

E:\DRIVE.E

F:\DRIVE.F

T:\DRIVE.T

P:\DRIVE.P

S:\DRIVE.S

I:\DRIVE.I (the PenDrive should be connected while the MapDrive.bat is running)

And then, run MAKEDRIVE.CMD

That'all :)

Link to comment
Share on other sites

How does work MapDrive.cmd?

  • List all the reassignable drives
  • Get all the letters the user wants to be fixed (search DRIVE.x on any drive, and CDR.x DVD.x on the system drive)
  • Run DISKPART to deassign all drives
  • Run DISKPART to reassign all drives

The batch creates some files as input to DISKPART (SELECT <volume> / REMOVE or ASSIGN <letter>)

Note: All the used files and all the environment variables are described in the batch itself.

Link to comment
Share on other sites

  • 6 months later...

A new version is ready, and I will begin a new thread as soon as I will release it in a few days (watch new threads :P).

News:

- Correction of something (now, reassignment in nearly 100% working).

- May DVD & CD could be used instead of only one ot both.

- Drives keeping the same letter, are not de/re-assigned.

- Variables renaming to be more clear.

- Better logfile (with error messages from DISKPART).

Note:

- The SLEEP.EXE is available on the Windows Server 2003 Resource Kit Tools.

- The corresponding translation of the search string could be found in files "xxx-xxx-csv-WindowsXP.csv" from the Microsoft FTP.

Link to comment
Share on other sites

Question about this...

I need to re-assign my drive letters early in my runonceex as there are many components that are based on my modified drive letters.

If I try to run this at the beginning of my runonceex, wont I get errors as the drive letter to the cdrom has changed?

:::EDIT::: SO my assumptions were correct.... if you try to reassign drive letters during runonceex i get errors immediately after because the cdrom drive letter changed. I tried applying in before my runonceex in cmdlines.txt and it didnt seem to take...

Any ideas??

Thanks!

Link to comment
Share on other sites

I put it in RunOneEx without any problem... but I never access my CD because all of my installation files are copied on my HD at the Window installation beginning (i.e. everything is is $OEM$\$1\Install\).

Perhaps, you should reboot after the drive letters changed...

ps: As I have not enough place on a CD, I am using DVD :rolleyes:

Link to comment
Share on other sites

well, it looks like Ill have to find another way to rename my drive letters then...

Another question I do have about this though... I have 2 CD-ROM drives, one vanilla and one CDRW. I want my CDROM to be I: and my CDRW to be J:.

I placed 2 files on my C: drive, 'CDR.I' and 'CDR.J'. The problem is when it re-assigns the drive letters it makes my CDRW I: and my CDROM J: - backwards...

One thing to note is Im running this mapdrive.cmd during my windows installation so the Volume label reads whatever the default Windows CD is... Not sure how your script works exactly- if it assigns by volume/label or what, but is there any way I can get what I want accomplished in regards to renaming my CD-ROM drives what I want?

Thanks.

Link to comment
Share on other sites

well, it looks like Ill have to find another way to rename my drive letters then...
I tried a lot of way to do this, and I always come back to the current solution.
Another question I do have about this though... I have 2 CD-ROM drives, one vanilla and one CDRW.  I want my CDROM to be I: and my CDRW to be J:.

I placed 2 files on my C: drive, 'CDR.I' and 'CDR.J'.  The problem is when it re-assigns the drive letters it makes my CDRW I: and my CDROM J: - backwards...

Net version will give the possibility to re-assign multiple CD and/or DVD. But I need more informations about what is returned by DISKPART; so could you run DISKPART and give the output of the command LIST VOL (especially what is displayed for your CD-R, CD-RW, DVD,...)? What I would like to have is someting like:
 Volume ###  Ltr  Nom        Fs     Type        Taille     Statut     Info
 ----------  ---  -------  ------  ----------  ----------  ---------  --------
 Volume 0     E                       DVD-ROM         0 B (Comment: CD-RW burner, DVD reader)
 Volume 1     M   XPCREATE     CDFS   DVD-ROM      859 MB (comment: DVD-RW burner)

One thing to note is Im running this mapdrive.cmd during my windows installation so the Volume label reads whatever the default Windows CD is...  Not sure how your script works exactly- if it assigns by volume/label or what, but is there any way I can get what I want accomplished in regards to renaming my CD-ROM drives what I want?
With your answer to my above question, I think I will be able to modify mapdrive so you will be able to set the letters as you want it :)

Note that mapdrive is based only on the DISKPART results (but DISKPART does not see any differences between a DVD-R burner and a DVD-RW burner :no:. I hope it will report different types for CD Reader and CD burner :unsure:)

Link to comment
Share on other sites

DISKPART> list volume

 Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
 ----------  ---  -----------  -----  ----------  -------  ---------  --------
 Volume 0     I   NV112005     CDFS   CD-ROM       146 MB
 Volume 1     J                       CD-ROM          0 B
 Volume 2     C   System       NTFS   Partition     57 GB  Healthy    System
 Volume 3     D   Storage-1    NTFS   Partition    112 GB  Healthy
 Volume 4     P   Page-File    NTFS   Partition   1537 MB  Healthy
 Volume 5     E   Storage-2    NTFS   Partition    278 GB  Healthy

DISKPART>

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