Eject CD/DVD drive infinitely using VBS

sameera15852

Member
Sep 4, 2008
1,504
132
0
Godagama, Homagama




VBScript (Visual Basic Scripting Edition) is an Active Scripting language developed by Microsoft that is modeled on Visual Basic. It can be used to perform some actions by adding coding. Now let’s have a look on how to eject CD/DVD drive by VBS.


1. Open a Notepad and paste the following code in it.
Set oWMP = CreateObject("WMPlayer.OCX.7" )
Set colCDROMs = oWMP.cdromCollection
if colCDROMs.Count >= 1 then
do
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next ' cdrom
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next ' cdrom
loop
End If
2. Now save it with any name with an extension of .vbs


Save%20file.PNG




3. Now you will get a file which look like the image below. Now open it to eject your CD/DVD drive continuously ( It will not allow you to insert the CD/DVD drive tray inside).


How to stop ejecting DVD/CD tray?



1. Press ctrl+shift+ delete or ctrl+shift+esc to open task manage.


2. In task manager go to the tab “Process” . Then select “wsript.exe” and

press “End process button”.


End%20process.PNG