Detect CD tray opening?

T

Terry Pinnell

I'm experimenting with various DVD-writing programs, such as
MemoriesOnTV, NeroVision etc. Typically, these open the tray when a
burn is finished. For very short tests I've been scribbling down the
time I started a run, going off to some other application like reading
my emails/newsgroups, and then noting the time when the tray opens.
But for long burns this is impractical, as I need to leave the PC and
may not get back for the completion. And in any case I'd prefer to
give the programs maximum resources.

So it would be handy to be able to automatically record the time when
my CD/DVD tray opens. Either the actual time of day (so I can manually
subtract the handwritten start time), or the elapsed time between two
events: an attended start, and an unattended finish signaled by the
tray opening.

I suppose another route would be to setup FileMon, or RegMon with a
filter of some sort to record only the required events, but I think
that might be complicated.

Anyone know of any simple utility that might do the job please?
 
C

Conor

Terry Pinnell said:
I'm experimenting with various DVD-writing programs, such as
MemoriesOnTV, NeroVision etc. Typically, these open the tray when a
burn is finished. For very short tests I've been scribbling down the
time I started a run, going off to some other application like reading
my emails/newsgroups, and then noting the time when the tray opens.
But for long burns this is impractical, as I need to leave the PC and
may not get back for the completion. And in any case I'd prefer to
give the programs maximum resources.

So it would be handy to be able to automatically record the time when
my CD/DVD tray opens. Either the actual time of day (so I can manually
subtract the handwritten start time), or the elapsed time between two
events: an attended start, and an unattended finish signaled by the
tray opening.

I suppose another route would be to setup FileMon, or RegMon with a
filter of some sort to record only the required events, but I think
that might be complicated.

Anyone know of any simple utility that might do the job please?
I have to ask....WHY?
 
W

Whip.Pan

Can you just use a keylogger type of program to do this? I dunno, I'm
just suggesting/asking.
 
C

Conor

Terry Pinnell said:
I thought that was implicit in my description. I'm making comparative
timings.
But seeing as the speed is going to be pretty much the same, again why?
Seems pretty pointless from here.
 
S

Sietse Fliege

Terry said:
I'm experimenting with various DVD-writing programs, such as
MemoriesOnTV, NeroVision etc. Typically, these open the tray when a
burn is finished. For very short tests I've been scribbling down the
time I started a run, going off to some other application like reading
my emails/newsgroups, and then noting the time when the tray opens.
But for long burns this is impractical, as I need to leave the PC and
may not get back for the completion. And in any case I'd prefer to
give the programs maximum resources.

So it would be handy to be able to automatically record the time when
my CD/DVD tray opens. Either the actual time of day (so I can manually
subtract the handwritten start time), or the elapsed time between two
events: an attended start, and an unattended finish signaled by the
tray opening.

I suppose another route would be to setup FileMon, or RegMon with a
filter of some sort to record only the required events, but I think
that might be complicated.

Anyone know of any simple utility that might do the job please?

A bit late, so perhaps of no use any more, but anyway.

I guess that no such utility exists, so I wrote a AutoHotkey script.
You can download the zipped executable (+ script) here:
http://s19.yousendit.com/d.aspx?id=2EBPD75YR07W214GFKQ95OYTEN
 
T

Terry Pinnell

Terry Pinnell said:
Brilliant - thank you. I'm burning a DVD at this moment, so I'll try
it tomorrow.

Sietse:

I got "Error: The CD/DVD drive should contain a disc and not be
currently accessing it." Tried two separate DVD-RW discs. First was
empty (i.e. recently erased). Second was a movie I'd recorded. Each
time there was no other DVD program running. I just placed DVD in the
V: drive tray, closed it, then ran 'cdstatus v'. The message appears
after a few seconds.
 
T

Terry Pinnell

Terry Pinnell said:
Sietse:

I got "Error: The CD/DVD drive should contain a disc and not be
currently accessing it." Tried two separate DVD-RW discs. First was
empty (i.e. recently erased). Second was a movie I'd recorded. Each
time there was no other DVD program running. I just placed DVD in the
V: drive tray, closed it, then ran 'cdstatus v'. The message appears
after a few seconds.

Sietse: A few minutes after posting that, I tried 'cdstatus t', with a
*CD* in my T: drive. No error message, and when I used Eject, up
popped the message giving me time of day.

Then I tried it with a CD in drive V: - and again it performed
perfectly.

It seems that it handles CDs, but doesn't like DVDs?
 
S

Sietse Fliege

Terry said:
It seems that it handles CDs, but doesn't like DVDs?

That's when you get when you can't fully test the script, :-(
The thing is, believe it or not, I have a DVD drive, but no DVD in the house
to test with. (The drive never has seen a DVD, I'm still a pre-DVD
kind-a-guy, I guess.) LOL

I don't quite understand why the script doesn't work, though.
I would think that testing for: "The drive contains a disc but is not
currently accessing it" should give the same result, whether CD or DVD.
Anyway, I changed the script slightly, now testing for: "The drive contains
no disc, or the tray is ejected".

You can download it here:
http://s51.yousendit.com/d.aspx?id=2BI2C25C8EG3Q38AADA6BBLO85

(Please read the READ ME FIRST.txt)
 
M

Mel

That's when you get when you can't fully test the script, :-(
The thing is, believe it or not, I have a DVD drive, but no DVD in the house
to test with. (The drive never has seen a DVD, I'm still a pre-DVD
kind-a-guy, I guess.) LOL

You may be able to test the DVD Drive without DVD Media by using a CD
instead. (My DVD Drive reads CDs too)
 
T

Terry Pinnell

Mel said:
You may be able to test the DVD Drive without DVD Media by using a CD
instead. (My DVD Drive reads CDs too)

But, as I mentioned, I did that and the original script worked OK. It
was only when it was a DVD disc that it failed.
 
T

Terry Pinnell

Sietse Fliege said:
That's when you get when you can't fully test the script, :-(
The thing is, believe it or not, I have a DVD drive, but no DVD in the house
to test with. (The drive never has seen a DVD, I'm still a pre-DVD
kind-a-guy, I guess.) LOL

I don't quite understand why the script doesn't work, though.
I would think that testing for: "The drive contains a disc but is not
currently accessing it" should give the same result, whether CD or DVD.
Anyway, I changed the script slightly, now testing for: "The drive contains
no disc, or the tray is ejected".

You can download it here:
http://s51.yousendit.com/d.aspx?id=2BI2C25C8EG3Q38AADA6BBLO85

(Please read the READ ME FIRST.txt)

Bingo! Thanks very much, that works perfectly now.
 
M

Mel

But, as I mentioned, I did that and the original script worked OK. It
was only when it was a DVD disc that it failed.
I was replying to Sietse Fliege not you Terry.
 
T

Terry Pinnell

Mel said:
I was replying to Sietse Fliege not you Terry.

I know <g>. My point was that Sietse would not have been able to
detect the problem under discussion by 'using a CD instead'.
 
M

Mel

I know <g>.

It appears that you don't know said:
My point was that Sietse would not have been able to
detect the problem under discussion by 'using a CD instead'.

It wasn't clear what your point was, but when checking drive status for
open or closed, I don't think it makes much difference as to what kind
of media (CD or DVD) is inserted into the DVD drive.
 
T

Terry Pinnell

Mel said:
It wasn't clear what your point was, but when checking drive status for
open or closed, I don't think it makes much difference as to what kind
of media (CD or DVD) is inserted into the DVD drive.

Then re-read the thread.
 
S

Sietse Fliege

Mel said:
You may be able to test the DVD Drive without DVD Media by using a CD
instead. (My DVD Drive reads CDs too)

Yes, I knew that. :)
I had tried out the script with a CD in the DVD drive and found it to be
working OK (like Terry later confirmed) and expected it to work for a DVD as
well, for good reasons. Otherwise I would not have posted the script in the
first place.
It wasn't clear what your point was, but when checking drive status for
open or closed, I don't think it makes much difference as to what kind
of media (CD or DVD) is inserted into the DVD drive.

It is a bit more complicated than that, Mel.
The script at the start checks if there is a disk in the drive.
The AutoHotkey function that I initially used yields an unexpected result.

Quoting from my earlier post:
"I would think that testing for: 'The drive contains a disc but is not
currently accessing it' should give the same result whether CD or DVD."

Well, to your and my surprise, that turned out to NOT be the case.
Apparently, with a DVD in the drive but without any program accessing it,
the AutoHotkey function returns that the drive is currently accessing the
DVD. Maybe a DVD region thingy in the background, I don't know, but I had
not anticipated it.

Once I knew, I slightly changed the script (used the same function in a
slightly different way).
 
M

Mel

Yes, I knew that. :)
I had tried out the script with a CD in the DVD drive and found it to be
working OK (like Terry later confirmed) and expected it to work for a DVD as
well, for good reasons. Otherwise I would not have posted the script in the
first place.


It is a bit more complicated than that, Mel.
The script at the start checks if there is a disk in the drive.
The AutoHotkey function that I initially used yields an unexpected result.

Quoting from my earlier post:
"I would think that testing for: 'The drive contains a disc but is not
currently accessing it' should give the same result whether CD or DVD."

Well, to your and my surprise, that turned out to NOT be the case.
Apparently, with a DVD in the drive but without any program accessing it,
the AutoHotkey function returns that the drive is currently accessing the
DVD. Maybe a DVD region thingy in the background, I don't know, but I had
not anticipated it.

Once I knew, I slightly changed the script (used the same function in a
slightly different way).
Thank You: For taking the time to explain the problems you encountered
while writing the AutoHotKey script; I appreciate the explanation.

Be Well,
Mel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top