Sign in to follow this  
Followers 0
Scribble

Howto tell a drive is a CD/DVD & ROM/RW?

5 posts in this topic

Hello,

This is my first post here, I'm just getting into AutoIT and I love it!

My question for you: Is there a way using an autoit script to find out the drivetypes of all driveletters in a system and to even see if a drivetype:CDROM is a DVD or CD and wheter it has writing(burning) abilities (without a CD/DVD being inserted)?

Thanx in advance guys!

Share this post


Link to post
Share on other sites



Try using DriveGetType(), DriveGetFileSystem(), or DriveStatus() to find info about a drive based on it's letter.

Or for a more advanced info, interface with DISKPART (on windows XP).

see my post at the end of this thread for an example of that.

Share this post


Link to post
Share on other sites

Try using DriveGetType(), DriveGetFileSystem(), or DriveStatus() to find info about a drive based on it's letter.

Or for a more advanced info, interface with DISKPART (on windows XP).

see my post at the end of this thread for an example of that.

<{POST_SNAPBACK}>

Thanx, but this doesn't give me option to see if a drive is DVD or CD and whether it's a writer or a reader... and I need that especially to set the driveletters accordingly in a system with Diskpart. so R: = reader W: = writer

Anyone?

Share this post


Link to post
Share on other sites

:)

Thanks for that beautifull piece of code Larry.

Gonna use it in my next unattended XP installation

$objWMIService = ObjGet("winmgmts:\\" & @computername & "\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_CDROMDrive")
For $objItem in $colItems
    if StringInStr($objItem.Name, "rw") then 
        run ("install nero.exe")
        Exit
    EndIf
Next

Share this post


Link to post
Share on other sites

try beta + COM + WMI. If this interest's you perhaps I can dig up a ditty... it will most likely only work on win2k/xp

$objWMIService = ObjGet("winmgmts:\\" & @computername & "\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_CDROMDrive")
For $objItem in $colItems
    MsgBox(4096,"","Device ID: " & $objItem.DeviceID)
    MsgBox(4096,"","Description: " & $objItem.Description)
    MsgBox(4096,"","Name: " & $objItem.Name)
Next

<{POST_SNAPBACK}>

Hi Larry,

It seems from Hoppy's adjustment this is what I would need!!! :evil:

But....the script doesn't find any cdrom drive in my system, so does nothing...

That's weird because there is a DVD writer on drive G:...

Can you tell me what I need to do to make it find that drive?

I already tried: Win32_DvdDrive but no such class exists... :)

Thanx again, you guys are really helpful to us newbies.

Share this post


Link to post
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
Sign in to follow this  
Followers 0