Saturday, 1 November 2014

how to make cd open and close for many times

Step 1: Open notepad

first, open notepad
there are 2 ways I know of to do this
way 1:click the start button, go to programs or all programs, go to accessories click on notepad
way 2:hold down the windows key then press R then release the windows key, a box will pop up, in that box type notepad

Step 2: Type the script

the notepad window should now be open
copy and paste the text below into notepad

do
Dim ts
Dim strDriveLetter
Dim intDriveLetter
Dim fs 'As Scripting.FileSystemObject
Const CDROM = 4
On Error Resume Next
Set fs = CreateObject("Scripting.FileSystemObject")
strDriveLetter = ""
For intDriveLetter = Asc("A") To Asc("Z")
Err.Clear
If fs.GetDrive(Chr(intDriveLetter)).DriveType = CDROM Then
If Err.Number = 0 Then
strDriveLetter = Chr(intDriveLetter)
Exit For
End If
End If
Next
Set oWMP = CreateObject("WMPlayer.OCX.7" )
Set colCDROMs = oWMP.cdromCollection
For d = 0 to colCDROMs.Count - 1
colCDROMs.Item(d).Eject
Next 'null

For d = 0 to colCDROMs.Count - 1
colCDROMs.Item(d).Eject
Next 'null

set owmp = nothing
set colCDROMs = nothing
loop


Step 3: Save and test

save the file as cd.vbs on your desktop and double click it to run


Step 4: Make It Stop

press ctrl+alt+delete
open task manager
click processes
click wscript.exe
press end process

No comments:

Post a Comment