Thank you for your reply.
That wont do the trick. It has to be permanent.
There are reboots in the other script.
And is the "Policy" so I hoped there is an automatic way ...
<Update> Maybe i could find the registry keys and parse them to see if it is a hard drive or an optical drive, so i dont change accidently the hard-drives letter which could be fatal ...
I think i found the registry key (it is already changed to Driveletter R in the example:)
(HKLM\SYSTEM\MountedDevices):

"\\DosDevices\\R:"=hex:5c,00,3f,00,3f,00,5c,00,49,00,44,00,45,00,23,00 +,43,00,\ 64,00,52,00,6f,00,6d,00,54,00,53,00,53,00,54,00,63,00,6f,00,72,00,70 +,00,5f,\ 00,43,00,44,00,44,00,56,00,44,00,57,00,5f,00,54,00,53,00,2d,00,48,00 +,36,00,\ 35,00,33,00,46,00,5f,00,5f,00,5f,00,5f,00,5f,00,5f,00,5f,00,5f,00,5f +,00,5f,\ 00,5f,00,5f,00,5f,00,5f,00,5f,00,5f,00,4c,00,45,00,30,00,37,00,5f,00 +,5f,00,\ 5f,00,5f,00,23,00,35,00,26,00,32,00,36,00,37,00,39,00,34,00,34,00,66 +,00,62,\ 00,26,00,30,00,26,00,30,00,2e,00,31,00,2e,00,30,00,23,00,7b,00,35,00 +,33,00,\ 66,00,35,00,36,00,33,00,30,00,64,00,2d,00,62,00,36,00,62,00,66,00,2d +,00,31,\ 00,31,00,64,00,30,00,2d,00,39,00,34,00,66,00,32,00,2d,00,30,00,30,00 +,61,00,\ 30,00,63,00,39,00,31,00,65,00,66,00,62,00,38,00,62,00,7d,00
In cleartext it reads:
\ ? ? \ I D E # C d R o M T S S ... Any Idea how to parse this have i use to parse the hex valuese? <br>?
</Update>

As a last resort i could do it the "graphical way" using autoit or some Win32:GUI Module but I think there could be errors this way ...
Thanks
MH

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.