Jump to content
Sign in to follow this  
dminion

CDROM Tray Lock

Recommended Posts

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

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

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

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  

×
×
  • Create New...