January 5, 200521 yr I thought there might be someone (like me) out there who doesn't want to open the CD tray manually when they're done installing so here is a windows script that ejects the cd tray.open.vbsConst CDROM = 4For Each d in CreateObject("Scripting.FileSystemObject").Drives If d.DriveType = CDROM Then Eject d.DriveLetter & ":\" End IfNextSub Eject(CDROM) Dim ssfDrives ssfDrives = 17 CreateObject("Shell.Application")_ .Namespace(ssfDrives).ParseName(CDROM).InvokeVerb("E&ject")End Sub
January 5, 200521 yr Author Well, I thought I should also post one to close it.. This one is a bit trickier. First of all you need wshAPIToolkitobject.ocx (one option). Copy it into system32 and run regsvr32 wshAPIToolkitobject.ocxclose.vbsDim oATO Set oATO = WScript.CreateObject("wshAPIToolkitObject.ucATO", "")Const ssfDRIVES = &H11Const DriveTypeCDROM = 4 Set oFS = Wscript.CreateObject("Scripting.FileSystemObject") Set oDrives = oFS.Drives For Each Drive in oDrives If Drive.DriveType = DriveTypeCDROM Then cdromDrvLtr = ("Drive.DriveLetter") End If Next Set oSH = CreateObject("Shell.Application")nRtn = oATO.CallAPI("WINMM.DLL", "mciSendStringA", "Set CDAudio door closed", 0, 0, 0)wshAPIToolkitObject.ocx
January 5, 200521 yr You have a robot to remove the CD from the already opened CD tray too? Maybe one to turn it on and put the CD in the tray to begin with...
January 5, 200521 yr this is posted on http://unattended.msfn.orgDownload: CDR - a command line CD Drive Ejector utilityCDR.exe is a command line utility which you can execute to eject one or more CD/DVD drives. This can be used as a replacement for the cd_eject.vbs script file, which wasn't all that great in terms of functionality. Use CDR.exe /? for a full list of switches and examples. Why would you want to use this tool? This can be handy to eject your Windows XP CD before performing replace/delete commands in the Windows or System32 directories, in which case Windows File Protection can intefere at times when the CD is in the drive.Usage: CDR.exe open ALLThanks to devil270975 for developing this tool for MSFN.orgIMO, this is easier
January 5, 200521 yr You have a robot to remove the CD from the already opened CD tray too? Maybe one to turn it on and put the CD in the tray to begin with...Maybe he's got hold of an ASIMO...
Create an account or sign in to comment