0

i am creating a just for fun batch file to do the same as in this video.

I don't know much about programming and i also can barely read what it says in the screen in that video from youtube.

I found this code online:

do

Set oWMP = CreateObject("WMPlayer.OCX.7" )
Set colCDROMs = oWMP.cdromCollection

if colCDROMs.Count >= 1 then
For i = 0 to colCDROMs.Count - 1
colCDROMs.Item(i).Eject
Next ' cdrom
End If    

I saved it as a .vsb script, and it looks like it work, but it all happen so fast that the tray closes at the half. How could i modify it to wait a couple of seconds once it is open?

Mat
  • 202,337
  • 40
  • 393
  • 406
Amir
  • 16
  • 4

1 Answers1

3

Add sleep command to make it sleep for five seconds (the argument is milliseconds) in the for loop

WScript.Sleep 5000
Uku Loskit
  • 40,868
  • 9
  • 92
  • 93