Program to Open/Close CD Tray?

MathCoder
You cannot solicit “gifts” in exchange for coding work here on the forums. That is a form of spamming. Please refrain from doing so in the future, or your posting privileges will be suspended.

Email addresses are also not allowed in the open forum, so I’ve removed yours.

[QUOTE=MathCoder;2587679]I had written a very complicated software to copy the CD/DVD disks. Open/Close the CDs is one functions of it. [B][I]Yes, it closes the CD with a click[/I][/B]. If you want, I can compile and take out the copy command. Send me a gift or something for the program I’m gonna to write for you to just Open/Close the CD-player.

Vo Duc Dien[/QUOTE]

Oh, and by the by, this is a nine year old thread…:iagree:

Simplest - and free - solution: try Wizmo by Steve Gibson www.grc.com . It’s a small applet which can be configured to open/close cd-tray, along with many other functions. No cpu resources needed, ideal for managing numerous pc tasks. Just read the text:

============================

Wizmo

What’s Wizmo?
This is Wizmo. It is a little Windows Gizmo that I wrote because I couldn’t find one on the Net. Apparently no one had written one. And besides, even if they had, it would probably be obscenely fat and annoying. (And please don’t tell me that you know of one now. You’re too late. Where were you yesterday?)

Windows new power management stuff is pretty cool – when it works. But sometimes you really don’t want “timed operation.” You want control. That’s what this first version of Wizmo was created to provide.

And Wizmo is also a nice little platform for collecting “stray needs” as time goes by. As people suggest other things that it could also do – as they surely will – I’ll add them and Wizmo will grow.

All the while Wizmo will remain
free and tiny and fast and cool.

There you have it.

For Example . . .
You want your screen saver’s startup to be set for a long enough delay so that you don’t have to keep moving the mouse around or hitting a shift key just to keep the screen awake – like while you’re on the phone.

But other times you want the screen to be blanked right away – like when you finally push yourself away from the keyboard to go find a shower or some food. At those times you know that you won’t be using the computer for a while, and it’s really annoying (while you’re in the shower) to think of the screen just sitting there, waiting a long time to start blanking. (At least it really annoys me.)

This is especially true in the case of screen power management. It would be way cool to be able to click a single button and turn off the screen power. Bang! Just like that. Goodnight.

But I couldn’t find anything to do that.

So I wrote this Wizmo.

How does it work?
When Wizmo is started up without any command line parameters, it presumes that you don’t (yet) know how it use it, so you get this user-interface. Or if it finds some command line stuff that it can’t figure out, then it presumes that you still don’t (quite) know how to use it (or you guessed wrong) . . . so, again, you get this helpful user-interface.

BUT . . . if Wizmo is started up with some command line stuff that it understands, then you see nothing at all. If you have sound working, you’ll hear “The Gibson Sigh” sound . . . which is conveniently timed to give you a chance to let go of the mouse and step away from your computer. After the “sigh” is finished, the action specified in the Wizmo command line will be executed.

That’s all there is to it.

How Are Commands Given?
• First, you’ll want to place this little wizmo.exe file somewhere convenient in your system. Your Windows or Windows\System directories are good choices since Windows likes to look there for executable files.

• Then you should create a Windows shortcut from that file, placing the shortcut on your desktop, in your start menu, on your Windows desktop toolbar, in your pocket or wherever is convenient.

• Next, edit the shortcut’s command (by right-clicking on the shortcut and choosing “Properties…”). Add one of the “command verbs” (shown below) to the end of the command line (after first adding a space character of course).

• Next, press the “Change Icon” button to choose the icon appearance you desire for this Wizmo command.

• Finally, save the edited shortcut.

When you click on the shortcut, this wizmo program will be executed. It will find the command you added and perform the function you have requested. That’s all there is to it.

Note also that any means for executing a command can be used for testing and familiarization. A DOS Prompt could be used for issuing Wizmo commands, or the WIndows’ Start button “Run…” option.

Okay, so what Commands?
You may place any one of the following command parameters after the wizmo.exe command:

blackout
• Blank screen to ‘basic black’.
Leaves screen power on, but blanks to black. (Other colors can be chosen, see ‘desktop’ option below.)
Example: wizmo blackout

desktop
• Blank screen to ‘desktop’ color.
If you would prefer to blank to a uniform color other than black, you can specify the ‘desktop’ color using the Windows desktop properties ‘Appearance’ tab. This blanks to that color.
Example: wizmo desktop

blank
• Activate screen blanker (saver).
Activates the system’s currently registered screen blanker (saver).
Example: wizmo blank

autoblank=
• Enable/Disable timed blanking.
Enables or disables the automatic timed activation of the system’s built-in chosen screen saver. Use “0” to disable timed blanking, “1” to enable it.
Example: wizmo autoblank=0

monoff
• Turn off all monitors.
If the computer and monitor(s) supports advanced power management (APM), this immediately powers down the system’s monitor(s).
Example: wizmo monoff

standby
• Place computer in standby mode.
This is the mode – if supported – from which Windows can (sometimes) resume quickly. But it’s still Windows, so save your files first.
Example: wizmo standby

hibernate
• Trigger hibernation.
This is the mode – if supported – in which Windows can stay indefinitely since it copies the system to the system’s permanent storage. If hibernation is not supported the effect will be the same as “standby”.
Example: wizmo hibernate

logoff
• Log the current user off.
Shuts down all processes and logs the current user off the machine.
Example: wizmo logoff

exit
• Exit from Windows.
Gets out of all applications and exits Windows to the “safe to turn off” state.
Example: wizmo exit

reboot
• Restart (reboot) the computer.
Exits then restarts Windows.
Example: wizmo reboot

shutdown
• Shutdown the computer.
Shuts down and exits windows, then powers off the machine (if supported).
Example: wizmo shutdown

open
• Open system’s CDROM.
Opens the system’s cdrom tray.
Example: wizmo open

open=
• Open specific removable drive.
Opens or ejects the drive letter specified.
Can be a Zip, Jaz, etc.
Example: wizmo open=r:

close
• Close system’s CDROM.
Closes the system’s cdrom tray.
Example: wizmo close

close=
• Closes specific removable drive.
(NT/Win2K/XP only) Closes the drive letter specified.
Example: wizmo close=r:

volume=
• Set audio volume percentage.
Sets the machine’s audio volume as a percentage: 0 to 100.
Example: wizmo volume=50

mute=
• Mute the system’s audio.
Mute=1 or Mute=0 enables and disables the system’s audio.
Example: wizmo mute=1

play=
• Play a wave (.wav) file.
Play={wavefile} plays the specified wave file.
Example: wizmo play=chimes.wav

wave=
• Set wave-file audio volume percentage.
Sets the machine’s wave file audio volume as a percentage: 0 to 100.
Example: wizmo wave=25

shake=
• Set mouse unblanking sensitivity.
Specifies how far the mouse must be moved to unblank the screen. ‘shake=0’ disables mouse unblanking.
Example: wizmo shake=0

quiet
• Suppress the “Gibson sigh” sound.
Forces Wizmo to be quiet.
Example: wizmo quiet

wanlock
• Prevent WiFi disconnections.
This temporarily (until reboot or “wanopen”) stops the Windows Wireless Zero Configuration (WZC) service which is typically responsible for periodic WiFi disconnections.
Example: wizmo wanlock

wanopen
• Undo effect of “wanlock”.
This restarts the Windows Wireless Zero Configuration (WZC) service that may have been stopped by Wizmo’s “wanlock” command. You may wish to do this when moving your laptop to another network.
Example: wizmo wanopen

graviton
• Activates the graviton screen saver.
Performs N-Body gravitational attraction simulation. This verb must follow the other graviton parameters (if any).
Example: wizmo graviton

particles=
• Specify graviton particle count.
Counts from 2 through thousands are possible.
Example: wizmo particles=10

line
• Diagonally aligns particles
Creates pleasing symmetrical displays.
Example: wizmo line graviton

grid=
• Creates an initial particle grid
Another option for symmetrical displays.
Example: wizmo grid=10,6

trails=
• Specifies particle trail length, if any…
The number of path steps to display.
Example: wizmo trails=50

gravity=
• Specifies the gravitational force.
Numbers from 1 through millions are interesting.
Example: wizmo gravity=1000

sun=
• Creates a centered gravity well.
Places a sun of specified gravity in the center of the screen.
Example: wizmo sun=50000

blackhole=
• Creates an invisible gravity well.
Places a “blackhole” of specified gravity in the center of the screen.
Example: wizmo blackhole=50000

infinite
• Specifies an unbounded (infinite) surface.
By default, the screen is bounded. But this allows particles to venture outside the screen’s boundaries.
Example: wizmo infinite

elastic
• Makes the screen edges elastic.
By default, the screen is bounded and kills the velocity perpendicular to the boundary’s edge. The elastic option makes the screen edge perfectly elastic so particles bounce.
Example: wizmo elastic

stop
• Stops particles at screen boundary.
By default, the screen is bounded and kills the velocity perpendicular to the boundary’s edge. The stop option kills both directions (components) of the particle’s velocity so that any particle attempting to leave the screen is stopped cold.
Example: wizmo stop

Using Graviton:
A typical invocation of the graviton would be:

wizmo trails=10 particles=10 gravity=500 graviton

NOTES:
• Graviton computation and display are highly dependent upon available processing power. Fewer particles and shorter (if any) trails will minimize the system load and maximize refresh rates.

• Graviton uses and requires “DirectX” support, though it deliberately uses only the earliest version features.

That’s it?
Not quite . . . Three more things:

Windows Bugs:
I wrote this in just a few hours and from an “untested” reading of Microsoft’s Windows documentation of the “ExitWindows” function. It turns out that Microsoft fully acknowledges that there are a whole bunch of bugs in this area of Windows. (Yeah, like that’s surprising news.) So I was disappointed, by not very surprised, when several users of this program reported things like the “exit” command turning off their computer rather than just exiting from Windows . . . and things like that.

Someday I may turn this into a really solid bit of freeware, but not today. I am using it just for the “monoff” feature which I originally wanted, so you are welcome to use it if it’s of any use to you. It’s nice and solid software. And whatever it does, it does consistently, but apparently with some variation from machine to machine depending upon how the Windows Exit bugs operate on your machine. <grumble>

Simple “linear” programming:
Since Wizmo’s commands are executed one at a time, it’s possible to create simple scripts on the command line. For example:

wizmo mute=1 blackout mute=0

This would mute the system’s speaker then activate Wizmo’s simple blackout saver. When the blackout saver is cancelled the mute will be released and Wizmo will terminate.

Many other combinations are possible, like turning UP the volume while you are away from the computer and the screen is blanked, then returning the volume to its usual level when you return and unblank the screen.

The Damit Variations:
We’ve all had the annoying experience of Windows deciding that it doesn’t want to shutdown, reboot, restart, or whatever. So I added another handy feature:

The standby, logoff, exit, reboot, & shutdown commands (the ones that can be finicky) all accept an optional exclamation point “!”. For example, “reboot!” (pronounced “reboot damit!”), which forces the function to succeed even if programs or device drivers have refused to give Windows their permission to be shutdown.

Emergency Damit Variations:
And . . . since you can never know when you might need the “Damit Variation”, if you don’t want to pre-set a shortcut that way, you can request a one-time damit variation by holding down either of the shift keys when launching Wizmo. You will hear a double-sigh confirming the recognition of the “damit variation.”

Please Note: The "Damit Variations"
are POTENT, so please be sure to
save your files and close things
down before using them. . .

That’s it?
Yes, for now. As I said, I only wanted to be able to turn off my monitors and I couldn’t find anything to do that. Now I can … and so can you. I expect that this little Wizmo will grow and become more powerful over time.

Do you have anything that
a single click should do?

If you have an idea for Wizmo, you may drop a note to me at wizmo@grc.com and tell me about your idea for a new Wizmo function. Or if you have some icons you’d like to see added to Wizmo’s library, you’re invited to send them to me at that address.

• Who am I?
• Why is this Free?
• Why is this Program so
Cool and Small and Fast?
This program is free because it took only a few hours for me to crank out and I don’t charge for stuff that only takes me a few hours. In fact, I don’t even charge for things that take me many months. But that’s another story . . .

I’m Steve Gibson. If my name doesn’t mean anything to you, that’s okay, it means everything to me . . . which is, incidentally, the answer to the third question. I care about the quality of what I create. I know that everyone says that, but just look at all the crappy software in your computer. All of that was written by people who say they care about quality. But I think we all know that they only care about getting paid and taking a vacation. Not me. Vacations are boring.

All of my programs are so small and so fast because I write only in the one, true, computer language: Assembly Language. All other languages reduce to assembly language, but they lose a lot in the translation. (Judge for yourself.)

People who can’t program in assembly language (just about everyone) get really annoyed with me when I talk about how much better it is than their pet language. But it’s not my fault if they just say they care about quality.

Which would YOU rather use?

If you are curious, you can find out all about my work from my web site, where I do cool things like repair hard drives and think about and address the lack of security and privacy on the Internet:

http://grc.com
"grc" stands for Gibson Research Corporation

I hope you enjoy and get lots of use out of this little Wizmo. If you want to know when new, enhanced, versions of it are available, check back at grc.com from time to time, or you can join my free eMailing list where I never send too much mail and you can leave anytime:

http://grc.com/mail.htm

– Steve Gibson

Please Note: This program is Copyright © 2000 by Gibson Research Corporation, Laguna Hills, CA, USA, Earth. – ALL RIGHTS RESERVED. This program is FREEWARE and may be freely copied and distributed onto and through any and all computer media.

What I use is a shortcut to the DVD drive sent to the Desktop.
If you have VirtualClone Drive installed the right click menu of the shortcut will have both eject & close tray. Not quite a one click solution but it works for me.