Change a drive letter from Command Prompt or batch script in Windows 8?

7,832

There are several methods:

  • mountvol – use it once to delete an existing letter, then again to assign a new one;

  • diskpart – interactive;

  • diskmgmt.msc aka Disk Management – a graphical tool.

Whichever you choose, assigning once should be enough, the assignment will be remembered afterwards.

Share:
7,832

Related videos on Youtube

Eshwar
Author by

Eshwar

Moved to ubuntu a while ago, and haven't regretted it! Its fantastic and goes along well with me wanting to help others when they in trouble :) Profession wise, mechanical engineer and i do my day to day work in ubuntu :) got most of the software i need!

Updated on September 18, 2022

Comments

  • Eshwar
    Eshwar over 1 year

    I have an external hard drive that I connect often to my computer. At some point it was assigned letter G: and based on that my other software works.

    Nowadays, suddenly it gets letter F:

    Is there any way I can use a batch script to change the letter from F: to G:. I don't mind running the batch script manually?

    If so, what is the code I should use and will it need administrative permissions?

    • tvdo
      tvdo almost 11 years
      See diskpart and yes you need admin. In theory it should have remembered the drive letter, consider changing it manually on disk management first.
    • user1686
      user1686 almost 11 years
      @Bob: It could be that it only remembers drive letters after they have been assigned manually at least once.
    • Eshwar
      Eshwar almost 11 years
      Thanks! I have changed it a couple of times manually, but everytime it goes back to the old one.
    • BtF
      BtF almost 3 years
      I have noticed that it was remembered when I had one device using a drive letter. When I started using multiple devices with the same drive letter, they get forgot, I have not verified the hypothesis, but I guess Windows 10 remembers the last device assigned to a drive letter.