Jump to content

Recommended Posts

Posted

I am trying to get CDTray to work in a WinPE 2.0 environment to no avail. I've tried running it through Dependency Walker to see what dll's are missing or where the break point is, but the AutoIt developers have prevented that functionality. So this may be more of a developer question. What are the dependencies of the CDTray function?

Posted

For anyone that might be interested, I found that this will usually work in a WinPE environment:

$aDrives = DriveGetDrive("all")
If Not @error Then
    For $i = 1 To $aDrives[0]
        If DriveGetType($aDrives[$i] & "\") = "CDROM" Then
            $sDrive = StringUpper($aDrives[$i]) & "\"
            ExitLoop
        EndIf
    Next
EndIf

$oShell = ObjCreate("Shell.Application")
$oShell.Namespace(17).ParseName($sDrive).InvokeVerb("Eject")

$iTimer = TimerInit()
While DriveStatus($sDrive) <> "NOTREADY" And TimerDiff($iTimer) < 10000
    Sleep(10)
WEnd

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
×
×
  • Create New...