.bat file eject cd command

  • Thread starter Thread starter Martin ©¿©¬
  • Start date Start date
M

Martin ©¿©¬

Hi
I'm constructing a .bat file to copy files to dvd using xxcopy and I
would like to eject the dvd when the .bat file has finished
I have been looking around and tried a few but no go
I'm not sure what I need or how to invoke the eject command in xxcopy

Can anyone help please?

Martin
©¿©¬
 
Hi
I'm constructing a .bat file to copy files to dvd using xxcopy and I
would like to eject the dvd when the .bat file has finished
I have been looking around and tried a few but no go
I'm not sure what I need or how to invoke the eject command in xxcopy

Can anyone help please?
Hi Martin.
Go to www.google.com and type in eject command in xxcopy
That`ll give you some ideas, I only looked at the first couple.
 
I'm constructing a .bat file to copy files to dvd using xxcopy and I
would like to eject the dvd when the .bat file has finished
I have been looking around and tried a few but no go
I'm not sure what I need or how to invoke the eject command in xxcopy

Can anyone help please?


Hi Martin,

When I was writing batch files for W2K and XP installations, I
frequently visited the alt.msdos.batch.nt newsgroup to ask questions
and get help. They've got some people in that NG who are really
talented writers.
 
Rich_on 15-Apr-2006 said:
Hi
I'm constructing a .bat file to copy files to dvd using xxcopy and I
would like to eject the dvd when the .bat file has finished
I have been looking around and tried a few but no go
I'm not sure what I need or how to invoke the eject command in xxcopy

Can anyone help please?

There is a tiny command line app called cdtray.exe here:

http://djlizard.net/software/one-minute-programs/

which has one function - to open or close a drive tray.
just add to your batch file after your xxcopy stuff.
 
Hi
I'm constructing a .bat file to copy files to dvd using xxcopy and I
would like to eject the dvd when the .bat file has finished
I have been looking around and tried a few but no go
I'm not sure what I need or how to invoke the eject command in xxcopy

Can anyone help please?

Martin
©¿©¬

You could use windows scripting host.

Save the javascript below as "eject.js"
To eject a cd at the command prompt "cscript eject.js [driveletter]"
e.g.
cscript eject.js E


/* eject.js */
drive=WScript.Arguments(0).replace(/^([a-z]):?\\?$/ig,"$1:\\");

var Shell= new ActiveXObject("Shell.Application");

var ssfDrives =17;

Shell.Namespace(ssfDrives).ParseName(drive).InvokeVerb("E&ject");

/* end of script */

Regards,
Mel.
 
Thank you very much Fran
nircmd did the trick
I've been searching for a command line utility that can do this for
ages

Regards
Martin
©¿©¬
 
Hi rich
I have been trying cdtray, but I couldn't get it to work
I'm new to all this command line stuff, so it's probably me that's at
fault not the cdtray

Thanks for your info
Regards
Martin
©¿©¬
 
Thanks Anonymous
I've been posting to alt.msdos.batch
I'll give alt.msdos.batch.nt a go

Regards
Martin
©¿©¬
 
Rich_on 16-Apr-2006 said:
Hi rich
I have been trying cdtray, but I couldn't get it to work
I'm new to all this command line stuff, so it's probably me that's at
fault not the cdtray

Just for reference: If your CD/DVD drive is a drive E:
you would add to your batch file

cdtray.exe open e

to close a tray is: cdtray.exe close e

obviously cdtray.exe has to be somewhere where the batch file can find it or
you can spell out the complete path.
 
Back
Top