Previous in Forum: Barcode scanner on ethernet with CPU 319-F DP   Next in Forum: Packard Bell Easynote R4622 Problems
Close
Close
Close
7 comments
Rate Comments: Nested
Guru
United Kingdom - Member - British

Join Date: Nov 2007
Location: Gloucestershire, England
Posts: 962

Closing CD drive

08/24/2009 12:35 PM

Hi.

I have a code saved in notepad as OpenCD.VBS, to open the CD drive. The code reads:

Dim oWMP
Dim colCDROMs

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

set owmp = nothing
set colCDROMs = nothing


Would this be modifiable to close the CD tray? I have tried changing "Eject" to "Close", but that comes up with an error saying

"Object doesn't support this property or method: 'Item(...). Close'

Code: 800A01B6"

__________________
bondy111
Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.
Guru
Popular Science - Biology - New Member Hobbies - Musician - New Member APIX Pilot Plant Design Project - Member - New Member Hobbies - CNC - New Member Fans of Old Computers - ZX-81 - New Member

Join Date: Jan 2007
Location: Centurion, South Africa
Posts: 3921
Good Answers: 97
#1

Re: Closing CD drive

08/24/2009 4:46 PM

I don't know VB but try "Load"

__________________
Never do today what you can put of until tomorrow - Student motto
Register to Reply
Guru
Popular Science - Weaponology - bwire Hobbies - Car Customizing - New Member

Join Date: Dec 2007
Location: Upper Mid-west USA
Posts: 7498
Good Answers: 97
#2

Re: Closing CD drive

08/25/2009 12:53 AM

Retract CD tray scripts

__________________
If death came with a warning there would be a whole lot less of it.
Register to Reply
Guru
Popular Science - Biology - life lover Hobbies - Musician - music lover Safety - Hazmat - better safe than sorry United Arab Emirates - Member - desert trek Technical Fields - Procurement - procurement

Join Date: Sep 2008
Location: Dubai, UAE
Posts: 744
Good Answers: 58
#3
In reply to #2

Re: Closing CD drive

08/25/2009 1:53 AM

cool!

  1. but how is this implemented?
  2. does this become a "permanent" option (Eject / Retract) that appears in the right-click menu for the CD-DVD/RW drive?, or do you need to execute some key-combinations to close the drive?

this questions is from a VBS dummy

__________________
Now the darkness only stays the night-time, in the morning it will fade away. -- George Harrison (All Things Must Pass)
Register to Reply Off Topic (Score 5)
Guru
United Kingdom - Member - British

Join Date: Nov 2007
Location: Gloucestershire, England
Posts: 962
#4
In reply to #3

Re: Closing CD drive

08/25/2009 3:13 AM

I put the shortcut in my quick launch. Then I just click the appropriate one.

__________________
bondy111
Register to Reply Off Topic (Score 5)
Guru
Popular Science - Biology - life lover Hobbies - Musician - music lover Safety - Hazmat - better safe than sorry United Arab Emirates - Member - desert trek Technical Fields - Procurement - procurement

Join Date: Sep 2008
Location: Dubai, UAE
Posts: 744
Good Answers: 58
#5
In reply to #4

Re: Closing CD drive

08/25/2009 3:42 AM

I copied that script, pasted it in Notepad, saved it as closeTray.vbs, created a shortcut and pasted the shortcut in my Quick Launch folder.

I double-click on the shortcut, but an error message says there's a VB compilation error. perhaps I need to compile this first? how do I do that?

__________________
Now the darkness only stays the night-time, in the morning it will fade away. -- George Harrison (All Things Must Pass)
Register to Reply Off Topic (Score 5)
Guru
Engineering Fields - Electrical Engineering - New Member United States - Member - New Member

Join Date: Apr 2007
Location: Wichita, Kansas USA
Posts: 653
Good Answers: 30
#6

Re: Closing CD drive

08/25/2009 9:40 AM

Pardon me if this is a silly assumption, but I have to ask; what happens if you run the same script again? I know the switch on the front of the drive is press/open, press/close (a toggle type function). Perhaps the script works the same way? I have a multimedia keyboard, and it has buttons for Drive1 and Drive2 eject, and if they are pressed when the drive is open, they close. Perhaps too simple?

Tom

Register to Reply
Guru
Popular Science - Weaponology - bwire Hobbies - Car Customizing - New Member

Join Date: Dec 2007
Location: Upper Mid-west USA
Posts: 7498
Good Answers: 97
#7
In reply to #6

Re: Closing CD drive

08/25/2009 1:50 PM

You couldn't hold that cat eh?

__________________
If death came with a warning there would be a whole lot less of it.
Register to Reply Off Topic (Score 5)
Register to Reply 7 comments
Copy to Clipboard

Users who posted comments:

Bondy111 (1); bwire (2); Hendrik (1); langyaw (2); tdesmit (1)

Previous in Forum: Barcode scanner on ethernet with CPU 319-F DP   Next in Forum: Packard Bell Easynote R4622 Problems
You might be interested in: Bar Code Scanners, Bar Code Cards, Bar Code Software

Advertisement