Welcome to MSFN

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.


Sign in to follow this  
Followers 0
aspenjim

What's the command or exe file to eject cd's

8 posts in this topic

The reason I ask is that I put a laptop DVD-RW in a mini-PC and had to remove the faceplate for clearance. Rather than damage the eject button, I'd like to put a shortcut on the desktop to the eject command. I've searched the windows directory and looked at all of the exe files and none of them resemble anything that would eject.

0

Share this post


Link to post
Share on other sites

Here is a cmd script that willl open and close the cd

Save As OpenClose_CD.cmd

echo off && Cls && Mode 55,5 && Color 4f && Title Open Cd

Set VBS=%systemdrive%\OpenClose.vbs

Set VBS1=%systemdrive%\RemoveVBS.vbs

echo Preparing To Run The Script!

>> %vbs% Echo Dim ts

>> %vbs% Echo Dim strDriveLetter

>> %vbs% Echo Dim intDriveLetter

>> %vbs% Echo Dim fs 'As Scripting.FileSystemObject

>> %vbs% Echo Const CDROM = 4

>> %vbs% Echo On Error Resume Next

>> %vbs% Echo Set fs = CreateObject("Scripting.FileSystemObject")

>> %vbs% Echo strDriveLetter = ""

>> %vbs% Echo For intDriveLetter = Asc("D") To Asc("Z")

>> %vbs% Echo Err.Clear

>> %vbs% Echo If fs.GetDrive(Chr(intDriveLetter)).DriveType = CDROM Then

>> %vbs% Echo If Err.Number = 0 Then

>> %vbs% Echo strDriveLetter = Chr(intDriveLetter)

>> %vbs% Echo Exit For

>> %vbs% Echo End If

>> %vbs% Echo End If

>> %vbs% Echo Next

>> %vbs% Echo MSGBOX "YOUR CD IS: " ^& strDriveLetter,0 + 48,"CDROM=> " ^& strDriveLetter

>> %vbs% Echo Set oWMP = CreateObject("WMPlayer.OCX.7" )

>> %vbs% Echo Set colCDROMs = oWMP.cdromCollection

>> %vbs% Echo colCDROMs.Item(d).Eject

>> %vbs% Echo A1= msgbox ("Press key To Close Cd" ^& vbcrlf ^& " The Cd Will Close", 0 + 64, "Open Close Cd Tray")

>> %vbs% Echo colCDROMs.Item(d).Eject

>> %vbs% Echo set owmp = nothing

>> %vbs% Echo set colCDROMs = nothing

>> %vbs% Echo wscript.quit

start %vbs%

ping -n 12 127.0.0.1>nul

TASKKILL /F /T /IM Wscript.exe

TASKKILL /F /T /IM Wmiprvse.exe

>> %vbs1% Echo On Error Resume Next

>> %vbs1% Echo Dim ACT : Set ACT = CreateObject("WScript.Shell")

>> %vbs1% Echo Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")

>> %vbs1% Echo Loc = ACT.ExpandEnvironmentStrings("%SystemDrive%")

>> %vbs1% Echo Fso.Deletefile("%VBS%")

>> %vbs1% Echo Fso.Deletefile(Loc ^& "\CD-Open-Close.cmd")

>> %vbs1% Echo Fso.Deletefile("%VBS1%")

>> %vbs1% Echo Set ACT = Nothing

>> %vbs1% Echo Set Fso = Nothing

start /w %vbs1%

exit

0

Share this post


Link to post
Share on other sites

autoit3 does it vry easily

jusy copy this code and change "E" to whatever ur drive's letter is. you can also change "open" to "closed"

CDTray("E:", "open")

0

Share this post


Link to post
Share on other sites

theres that option too, lol. unless he wanted to make it into a shortcut button like f7 or something like that.

0

Share this post


Link to post
Share on other sites
autoit3 does it vry easily

Do you not have to have it installed for it to work, I am just asking, as the script

I posted does not require any third party stuff.

0

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

  • Recently Browsing   0 members

    No registered users viewing this page.