re: DVD burner - BATCH to open/close tray - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Hardware > Hardware Repairs and Troubleshooting
Closed Thread
Thread Tools Display Modes
Old 08-02-2006, 12:28 PM   #1 (permalink)
S e c u r e d
Join Date: Feb 2005
Location: Somewhere Sunny
Posts: 3,760
Default re: DVD burner - BATCH to open/close tray

Here you go...


You can simply copy paste into a notepad, and make the extension a .bat

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>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%

brady is offline  
Old 08-02-2006, 01:57 PM   #2 (permalink)
Newb Techie
Join Date: Jul 2006
Posts: 24

that worked
travis22 is offline  
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Our Communities

Our communities encompass many different hobbies and interests, but each one is built on friendly, intelligent membership.

» More about our Communities

Automotive Communities

Our Automotive communities encompass many different makes and models. From U.S. domestics to European Saloons.

» More about our Automotive Communities

Marine Communities

Our Marine websites focus on Cruising and Sailing Vessels, including forums and the largest cruising Wiki project on the web today.

» More about our Marine Communities

Copyright 2002-2015 Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 02:43 PM.

Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2016, vBulletin Solutions, Inc.