Sign in to follow this  
Followers 0
dminion

CDROM Tray Lock

13 posts in this topic

Does anyone know of a way to lock and unlock the cdrom drive tray using auto it? I've looked around and have only found ways to do it in VB. Can someone please help?

Thanks,

dminion

Share this post


Link to post
Share on other sites



well this may not help but all i can think of is using a while loop and checking if it's open and if it is then close it...

--probably being usless ~cdkid


AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Yes you just has to use the MS mesie player activex component like in this example...

; Author:   Kåre Johansson
; AutoIt Version: 3.1.1.104
; Description: Very Simple component example: Open and close all CDROM / DVD drives
; Date: 27 Jan 2006

$oRP = ObjCreate("WMPlayer.OCX")

$cdroms = $oRP.cdromCollection
With $cdroms; Object tag pool
For $b = 1 To 10
    If .Count > 0 Then 
        For $a = 0 TO .Count - 1
            .Item($a).Eject
        Next
    EndIf

Sleep(3000)
If .Count > 0 Then 
        For $a = 0 TO .Count - 1
            .Item($a).Eject
        Next
EndIf
Next
EndWith 
$oRP = 0    
Exit

Simple as that...

kjactive :lmao:

Edited by kjactive

Share this post


Link to post
Share on other sites

Yes you just has to use the MS mesie player activex component like in this example...

; Author:   Kåre Johansson
; AutoIt Version: 3.1.1.104
; Description: Very Simple component example: Open and close all CDROM / DVD drives
; Date: 27 Jan 2006

$oRP = ObjCreate("WMPlayer.OCX")

$cdroms = $oRP.cdromCollection
With $cdroms; Object tag pool
For $b = 1 To 10
    If .Count > 0 Then 
        For $a = 0 TO .Count - 1
            .Item($a).Eject
        Next
    EndIf

Sleep(3000)
If .Count > 0 Then 
        For $a = 0 TO .Count - 1
            .Item($a).Eject
        Next
EndIf
Next
EndWith 
$oRP = 0    
Exit

Simple as that...

kjactive :lmao:

I'm not sure I follow... how exactly will this lock the drive tray? It looks like it just opens and closes drive trays...

Thanks,

dminion

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

http://people.eku.edu/gumpp/AutoIt/cdtool.exe

;Usage:

Run("cdtool.exe Lock E:")

Run("cdtool.exe Unlock E:")

It doesn't do any input validation so make sure the drive letter is valid....

Also, if you end up calling LOCK many times on the same drive, you will need to call UNLOCK that many times....

Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

http://people.eku.edu/gumpp/AutoIt/cdtool.exe

;Usage:

Run("cdtool.exe Lock E:")

Run("cdtool.exe Unlock E:")

It doesn't do any input validation so make sure the drive letter is valid....

Also, if you end up calling LOCK many times on the same drive, you will need to call UNLOCK that many times....

cdtool.exe is au3 ?

Share this post


Link to post
Share on other sites

Anyone with autoit source for this type of thing?

I want to check if the drive is locked then unlock it.

Thanks.


2015 - Still no flying cars, instead blankets with sleeves.

Share this post


Link to post
Share on other sites

post some vb code that does exactly what you want, and we can probably convert it to autoit.


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

You mean search for VB code that does the same thing?

I don`t have a clue when it comes to VB, sorry...


2015 - Still no flying cars, instead blankets with sleeves.

Share this post


Link to post
Share on other sites

you said "I've looked around and have only found ways to do it in VB."

So, show us what you have found, and we can probably convert it.


The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

Huh?? :P

This is what I posted...

Anyone with autoit source for this type of thing?

I want to check if the drive is locked then unlock it.


2015 - Still no flying cars, instead blankets with sleeves.

Share this post


Link to post
Share on other sites

Huh?? :D

This is what I posted...

:P When I asked for VB code, it was directed at the OP, not you.

The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

Share this post


Link to post
Share on other sites

Ah, sorry... :">


2015 - Still no flying cars, instead blankets with sleeves.

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