in reply to Re^3: How to change the drive letter for a CD/DVD drive on Windows?
in thread How to change the drive letter for a CD/DVD drive on Windows <b>Update: with a script</b>?

Thx. That was it. Since DVD/CD Drives seem to be volume 0 it is as simple as:
diskpart /s script.txt

script.txt: select volume=0 assign letter=R list volume

Thanks
MH
You saved my day ...
  • Comment on Re^4: How to change the drive letter for a CD/DVD drive on Windows?
  • Download Code

Replies are listed 'Best First'.
Re^5: How to change the drive letter for a CD/DVD drive on Windows?
by BrowserUk (Patriarch) on Dec 04, 2009 at 15:56 UTC

    You might want to at least consider the possibility of multiple drives or other volume assignments:

    #! perl -slw use strict; my @vols = split "\n", `diskpart /s listvol.txt`; print for @vols;

    Where listvoe.txt contains:

    list volume

    Will get you the volume list. You can then grep on /ROM/ and tease the line(s) apart to get the volume number.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Perfect.Good idea to get a safety net. It seems it could be also "DVD" i wonder if "blue ray" e.g. produce another output,
      but so far it will work since or new machines only got DVD-ROM drives ...

      list volume: Volume 0 R DVD
      Thanks
      MH