Jump to content

What is my cdrw drive.au3


Rick
 Share

Recommended Posts

Thought I'd share this script as it may come in useful for others.

Ever wanted to know the Drive letter of the CD-RW drive as used by the xp cd burning process??

Well this does it, works with Win95 upwards, feel free to edit it as you wish.

Rick

ReEdited 27/6/6 to seek out the cdrw differently.

What_is_my_cdrw_drive2.au3

Edited by Rick

Who needs puzzles when we have AutoIt!!

Link to comment
Share on other sites

Thought I'd share this script as it may come in useful for others.

Ever wanted to know the Drive letter of the CD-RW drive?

Well this does it, works with Win95 upwards, feel free to edit it as you wish.

Rick

Cool script. AutoIT already has a "DriveGetDrive()" function built in that can streamline the process.

$drv = DriveGetDrive( "CDROM" )

If NOT @error Then
    For $i = 1 to $drv[0]
        MsgBox(0,"CD Drive", "CD drive is: " & $drv[$i])
    Next
EndIf
Link to comment
Share on other sites

Cool script. AutoIT already has a "DriveGetDrive()" function built in that can streamline the process.

$drv = DriveGetDrive( "CDROM" )

If NOT @error Then
    For $i = 1 to $drv[0]
        MsgBox(0,"CD Drive", "CD drive is: " & $drv[$i])
    Next
EndIf
Differnece is CD-Rom to CD-RW in this case....
Link to comment
Share on other sites

If you want me to add an array of burner drives then i'll do it, altho my main purpose was just to establish the drive letter of the main cd-rw drive as used by the xp cd burning process.

Let me know, if ya want it

Edited by Rick

Who needs puzzles when we have AutoIt!!

Link to comment
Share on other sites

HI,

nice, but my Combo-drive has the burner on d: and your script shows f:. :">

I'll have to look at it.

Thanks 4 sharing!

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Odd, as the reference i seek in the script is the DriveIndex stored for the xp cd burning capabilty at:

RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CD Burning", "DriveIndex") , i then do a DriveGetDrive( "All" ) , DriveIndex being the drive

let me know if you suss it

Edited by Rick

Who needs puzzles when we have AutoIt!!

Link to comment
Share on other sites

Not sure if it'll help you identify a better way to detect the CDRW, but here is my registry settings for the CD Burning tree:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CD Burning]
"CD Recorder Drive"="\\\\?\\Volume{ad0c7710-ecd7-11da-9ff4-806d6172696f}\\"
"DriveIndex"=dword:00000004

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CD Burning\Current Media]
"TotalBytes"=hex:00,78,6c,7a,00,00,00,00
"FreeBytes"=hex:00,00,00,00,00,00,00,00
"Media Type"=dword:00000002
"UDF"=dword:00000001
"Disc Label"="MY DVD"
"Set"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CD Burning\Drives]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CD Burning\Drives\Volume{46ca700a-ecbb-11da-908e-00508dd19761}]
"Drive Type"=dword:00000003

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CD Burning\Drives\Volume{ad0c7710-ecd7-11da-9ff4-806d6172696f}]
"Drive Type"=dword:00000002
"CurrentCDWriteSpeed"=dword:ffffffff
"MaxCDWriteSpeed"=dword:0000007c
Link to comment
Share on other sites

Ok, heres goes... I've edited my original Script to look at "Mounted" devices instead of using DriveGetDrive("All").

Can you guys test it for me ta Rick

Who needs puzzles when we have AutoIt!!

Link to comment
Share on other sites

Hi Rick,

works as designed! :D

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Works as expected for me too.

I take it that it'll just pick the first drive if you happen to have two CDRWs or perhaps a DVDRW and CDRW?

I thought i'd already answered that further up ^^^^^^^^

Who needs puzzles when we have AutoIt!!

Link to comment
Share on other sites

  • 2 years later...

Hi!

I'm new to autoit. Could someone give me an example of writing the value of the cdrw drive letter to a file insted of a msgbox? I have tried on my own with out any luck.

Gyppie

Post the question in support please.

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

good job, there. i was actually working on the information retrieved from cd burning registry key to get the drive information.

and got just what i was about to do. this was further to someone's request here. i used to have a utlitity (closed source) to detect all capabiliiltes of a given optical drive and i intend to build one such soon, considering that IMAPI2 has already been ported to autoit ... (i had quit half way because i didnt have enough time to concentrate on studying imapi2 interface..

your code is good. thanks man.it will come handy.

Link to comment
Share on other sites

in line with my earlier note , i had been working on retrieveing info from guid , and found the dll call in msdn and as usual, people had already ported it into autoit. so , saved lottts of time (coz i am very bad at dllcalls and errors are unpredictable so need to spend too much time to get it working!)

here's what u can do , for getting the drive information.

This version might seem a little longer but 1) get last error is avoidable, its very rare that the registry call would be needed, so if the code needs to be small use second version

_GetCDDrive.au3

_GetCDDrive._Full.au3

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...