DVD insertion to run batch file

  • Thread starter Thread starter Rick Merrill
  • Start date Start date
Rick said:
How do I get a batch file to start
when a DVD is inserted?

Please be specific.

From the DVD on any machine (cannot technically be done - since autorun is
often disabled)?
On a specific machine of yours for any and all DVD types?
 
Shenan said:
Please be specific.

From the DVD on any machine (cannot technically be done - since autorun is
often disabled)?
On a specific machine of yours for any and all DVD types?

I only put dvd's in this DVD drive on a PC, and since
this is a windows xp group I assumed that was clear.

Let's assume I enable autorun - then what?

DVD+RW but I think that is irrelevant.
 
Rick said:
How do I get a batch file to start
when a DVD is inserted?

Shenan said:
Please be specific.

From the DVD on any machine (cannot technically be done - since
autorun is often disabled)?
I only put dvd's in this DVD drive on a PC, and since
this is a windows xp group I assumed that was clear.

Let's assume I enable autorun - then what?

DVD+RW but I think that is irrelevant.

Let me expand on my qeustions...

First - people do not just come here to fix individual problems. It is
plausible you are looking for a solution to a problem you expect to face on
many different machines (Windows XP, sure - maybe). In your case I was
trying to clarify if you wanted to know:

- How to create an autorun.inf and associated file on the actual DVD itself
so that any machine with autorun enabled would take that autorun.inf and do
what it said do (run the file on the DVD).

or

- When you insert a DVD - any DVD, you would like autorun to do something
*specific* for you on your machine - like run a batch script you wrote and
stored on the C drive of your machine.

All I asked for was clairification of what you were asking.

Yes - it is/was not obvious. I cannot read your mind, I cannot see you or
your computer, I do not know your intentions/needs/wants. I am asking these
questions because it is not clear.

You left much to the imagination with your one sentence query.
 
Shenan said:
Rick said:
How do I get a batch file to start
when a DVD is inserted?

Shenan said:
Please be specific.

From the DVD on any machine (cannot technically be done - since
autorun is often disabled)?


Let me expand on my qeustions...

First - people do not just come here to fix individual problems. It is
plausible you are looking for a solution to a problem you expect to face on
many different machines (Windows XP, sure - maybe). In your case I was
trying to clarify if you wanted to know:

- How to create an autorun.inf and associated file on the actual DVD itself
so that any machine with autorun enabled would take that autorun.inf and do
what it said do (run the file on the DVD).

or

- When you insert a DVD - any DVD, you would like autorun to do something
*specific* for you on your machine - like run a batch script you wrote and
stored on the C drive of your machine.

All I asked for was clairification of what you were asking.

Yes - it is/was not obvious. I cannot read your mind, I cannot see you or
your computer, I do not know your intentions/needs/wants. I am asking these
questions because it is not clear.

You left much to the imagination with your one sentence query.

So much for succintness ;-)

# Open Windows Explorer by pressing the Windows + "e" key.
# Right-click the desired CD-ROM and select Properties from the menu.
# Select the AutoPlay tab

How do I connect the autoplay OK to start "copy.bat"? Do I need to
modify the registry to add another choice or what?
 
How do I connect the autoplay OK to start "copy.bat"? Do I need to
modify the registry to add another choice or what?

You need not. AUTORUN.INF is a unique filename, the
only one that Windows executes immediately when found:
so you write in your BATch file whatever you want, then
name it AUTORUN.INF.
See http://support.microsoft.com/kb/967715
 
Actually, I do not want to change the DVD (which is from a series of
privately made recordings for public access TV) - rather I want the PC
to detect that a DVD has been inserted and copy the VOB files to the
hard drive.  It does not yet appear that that is possible.

@ECHO OFF
IF NOT EXIST C:\VOBFILES mkdir c:\VOBFILES
XCOPY *vob c:\VOBFILES
EXIT
 
Hodges said:
@ECHO OFF
IF NOT EXIST C:\VOBFILES mkdir c:\VOBFILES
XCOPY *vob c:\VOBFILES
EXIT

The method is good, but ... it needs to overwrite without asking and
how does it know to use the "E:" drive for the source?
 
The method is good, but ... it needs to overwrite without asking and
how does it know to use the "E:" drive for the source?

just put E: on the second line.

Now what I would like is a program to format DVDs so I can copy stuf TO them
with a batch file.
 
oK, but what is the name of the file and where do you put it? I can't
put it ON the DVD.

Presumably you give it a name in the autorun.inf file, and call it something
like VOBFILES.BAT
 
The method is good, but ... it needs to overwrite without asking and
how does it know to use the "E:" drive for the source?

to overwrite without asking use the /Y switch

@ECHO OFF
IF NOT EXIST C:\VOBFILES MKDIR C:\VOBFILES
CD /D E:
XCOPY /Y *vob c:\VOBFILES
EXIT

If you're running this FROM the dvd drive you should use a vbscript to
determine the drive letter though.
 
oK, but what is the name of the file and where do  you put it?  I can't
put it ON the DVD.

Like Steve said, just copy the text to a .txt file and rename it to
something like VOBFILES.bat

Doesn't matter where you put it if you use the corrected one I
posted. Could put it on your desktop or anywhere else. Double-click
to run. That's assuming everything's on the root of the drive. If
there are folders on the drive you should use XCOPY /Y E:\ C:\VOBFILES
That will copy everything on the DVD to the C:\VOBFILES folder. In
that case, you don't need the CD /D E:\ line.
 
Like Steve said, just copy the text to a .txt file and rename it to
something like VOBFILES.bat

Doesn't matter where you put it if you use the corrected one I
posted.  Could put it on your desktop or anywhere else.  Double-click
to run.  That's assuming everything's on the root of the drive. If
there are folders on the drive you should use XCOPY /Y E:\ C:\VOBFILES
That will copy everything on the DVD to the C:\VOBFILES folder.  In
that case, you don't need the CD /D E:\ line.

OOPS correction again. (I'm not quite awake yet)

XCOPY /E /Y E:\ C:\VOBFILES

E copies empty subdirectories.
You could also use /S instead of /E if you only want to copy
subdirectories with files in them.

@ECHO OFF
IF NOT EXIST C:\VOBFILES MKDIR C:\VOBFILES
XCOPY /S /Y E:\ C:\VOBFILES
EXIT
 
Hodges said:
OOPS correction again. (I'm not quite awake yet)

XCOPY /E /Y E:\ C:\VOBFILES

E copies empty subdirectories.
You could also use /S instead of /E if you only want to copy
subdirectories with files in them.

@ECHO OFF
IF NOT EXIST C:\VOBFILES MKDIR C:\VOBFILES
XCOPY /S /Y E:\ C:\VOBFILES
EXIT

OP wants to know if it's possible to repoint the action of clicking "OK" of
the autoplay prompt to kicking off this copying action. It seems to me that
this hurdle has yet to be addressed. (Although a desktop batchfile doesn't
take much hunting down and clicking on when you know you've inserted a DVD -
or a copy of the DVD could be made with the appropriate autorun.inf file
added.)
 
Olórin said:
OP wants to know if it's possible to repoint the action of clicking "OK" of
the autoplay prompt to kicking off this copying action. It seems to me that
this hurdle has yet to be addressed. (Although a desktop batchfile doesn't
take much hunting down and clicking on when you know you've inserted a DVD -
or a copy of the DVD could be made with the appropriate autorun.inf file
added.)

That is right: here is the situation: the computer is in Town Hall and
the power is off to the monitor (so I can't see the mouse). So I need
a keyboard shortcut that would launch the batch file. I say this now
becuase it looks like no auto-x function can do it, So I'll have to do
something.
 
Rick said:
That is right: here is the situation: the computer is in Town Hall and
the power is off to the monitor (so I can't see the mouse).

Doesn't really clarify your set-up or problem much, at least to me, sorry!
Can you run a remote desktop session to the computer, or use one of the
several free VNC apps? If you can't see the mouse, how do you know you'll be
doing the following correctly, which you described earlier:

[# Open Windows Explorer by pressing the Windows + "e" key.]
# Right-click the desired CD-ROM and select Properties from the menu.
# Select the AutoPlay tab
So I need
a keyboard shortcut that would launch the batch file. I say this now
becuase it looks like no auto-x function can do it, So I'll have to do
something.

That's easy: create the batch file as others have described, then create a
shortcut to it somewhere on your Desktop or in your Start Menu. On this
shortcut, right-click > Properties, click in "Shortcut key", press a key
combination (eg Ctrl+Alt+c) and OK back out. Ctrl+Alt+c should fire it off.

Sorry, I don't know what you mean by an "auto-x function".

NB: if you delete this shortcut, clear the "Shortcut key" field and press
Apply first. Otherwise, Windows can have a habit of holding on to that key
combination, playing havoc with future shortcuts you may want to create.
 
Back
Top