Change Driveletter Commandline Tool

Some time ago (2008 actually) I wrote a tool that can assign driveletters given a volumename. I use it myself after SysPrep operations to assign the desired drive letters. For instance after cloning a Virtual Machine from a template.

I noticed that I updated this tool sometime after the original post but never uploaded it here. The most important changes are:

  • When using ChDrvLetter without parameters it will list the currently assigned Drive Letters and Volumes:

ChDrvLetter v1.4 (c) Copyright 2008 by Remko Weijnen (www.remkoweijnen.nl)

Assigned Letters: [ACDZ]

Volume 0
Letter: C:\
Label :
Device: \Device\HarddiskVolume1
Name : \\?\Volume{c3acae19-dc1f-11df-8130-806e6f6e6963}\
Type : DRIVE_FIXED

Volume 1
Letter: Z:\
Label :
Device: \Device\CdRom0
Name : \\?\Volume{c3acae1c-dc1f-11df-8130-806e6f6e6963}\
Type : DRIVE_CDROM

Volume 2
Letter: A:\
Label :
Device: \Device\Floppy0
Name : \\?\Volume{c3acae1d-dc1f-11df-8130-806e6f6e6963}\
Type : DRIVE_REMOVABLE

Volume 3
Letter: D:\
Label : DATA
Device: \Device\HarddiskVolume2
Name : \\?\Volume{d45237f1-dc21-11df-8d8f-005056ae0001}\
Type : DRIVE_FIXED

  • There is a new DELETEONLY parameter that can be used to delete an existing Drive Letter assignment

ChDrvLetter DELETEONLY Letter
can be used to delete a drive letter Assignment

Example:
ChDrvLetter DELETEONLY D

  • the CDROM parameter can be used to change drive letter assignments for cd/dvd players:

ChDrvLetter CDROM Letters
can be used to assign drive letters to CD and/or DVD drives (because they have
no label when no cd/dvd is inserted

Example:
ChDrvLetter CDROM ZYX
Assigns Z to the 1st found CD/DVD drive, Y to the next etc.

I hope you like it, find the download below:

ChDrvLetter.zip (1247)

Leave a Reply

  1. Remko, thanks for updated v1.4.

    The v1.3 (dated 09-12-2008) didn’t really work as it ought to.

    v1.3 acted more like the DOS assign command, since when ChDrvLetter v1.3 was used, doing a list VOLUME in diskpart did not show the new drive letter for the disk partition in question. Diskpart still showed the old drive letter, but in Windows Explorer the new drive letter was visible. [ I don't understand why this was happenning ].

    However with ChDrvLetter v1.4, all new drive letters are are correctly reflected in diskpart’s volume list.

    Now with ChDrvLetter v1.4, for me, Diskpart becomes redundant for its cumbersome drive letter assignments, at last.

    ChDrvLetter v1.4 is a 103 KB gem.

    Thanks for sharing with the World. :) :thumbsup:

  2. Remko, thanks for updated v1.4.

    The v1.3 (dated 09-12-2008) didn’t really work as it ought to.

    v1.3 acted more like the DOS assign command, since when ChDrvLetter v1.3 was used, doing a list VOLUME in diskpart did not show the new drive letter for the disk partition in question. Diskpart still showed the old drive letter, but in Windows Explorer the new drive letter was visible. [ I don't understand why this was happenning ].

    However with ChDrvLetter v1.4, all new drive letters are are correctly reflected in diskpart’s volume list.

    Now with ChDrvLetter v1.4, for me, Diskpart becomes redundant for its cumbersome drive letter assignments, at last.

    ChDrvLetter v1.4 is a 103 KB gem.

    Thanks for sharing with the World. :) :thumbsup:

  3. Thank you for this tool. This allows me to automate drive assignments in our Windows deployment without me having to write a .NET utility utilizing Win32_LogicalDisk and Win32_Volume!

  4. Pingback: Change CD/DVD drive letter with RES Automation Manager

  5. Nice tool… i use to assign my backup drive letter.. some times he insists in get another letter and the backup do not run..