Re: AutoMove CD/DVD

"valery_vi" <[email protected]>
Newsgroups gmane.comp.windows.autoit.user
Message-ID <[email protected]>
This is more hard solution. 
It has two variants for code - so-called sex-script (male & female 
code)

$CDrive = 'f:'

$CDState = DriveStatus($CDrive & '\')
if $CDState = 'NOTREADY' then 
 CDTray($CDrive, 'closed')
else
 CDTray($CDrive, 'open')
endif
Sleep(2000)
$CDState = DriveStatus($CDrive & '\')
if $CDState = 'NOTREADY' then 
 $A = MsgBox(4,"CD/DVD drive ask!","Would you like to open me?",  2)
; female's logic
; Silence is the same as answer NO! 
 if $A = 6 then CDTray($CDrive, 'open')
; Silence is the same as answer YES! 
; uncomment this to apply male's logic
; if $A = -1 then CDTray($CDrive, 'open')
endif

If you support idea that 
"Silence is the same as answer NO" 
(female's logic)
then there is only reason to press {Enter}:
- CD/DVD tray is closed and empty and you want to open it.

elseif you support idea that
"Silence is the same as answer YES" 
(male's logic)
then there is not reason to press {Enter}

BTW This script will automove CD/DVD tray forward and back.
:-)

Valery

--- In [email protected], "valery_vi" <shehrer1@...> wrote:
>
> Hi,
> 
> I have this universal script to drive the CD/DVD device in any 
cases. 
> It (alone) can open the closed device and close the opened one.
> And it is good!
> :-)
> 
> ;Move CD/DVD tray
> $CDrive = 'f:'
> 
> $CDState = DriveStatus($CDrive & '\')
> if $CDState = 'NOTREADY' then 
>  CDTray($CDrive, 'closed')
> else
>  CDTray($CDrive, 'open')
> endif
> Sleep(2000)
> $CDState = DriveStatus($CDrive & '\')
> if $CDState = 'NOTREADY' then 
>  CDTray($CDrive, 'open')
> endif
> 
> However there is absurd with it, I think. Script works fine with 
disk 
> on tray, only. Try it.
> 
> How can I rewrite this script to move CD/DVD tray without CD/DVD 
disk 
> on it?
> 
> BTW. Explorer can 'Eject' the CD/DVD, only. Why? 
> 
> Any Ideas?
> Valery
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.