Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Automate Batch File

Sep 5, 2010 7:19AM PDT

I backup all of my data to an external USB hard drive, via a third-party backup program.

To do this, I have constructed a simple batch file (go.bat), that:

1. Is in the route directory, of the target drive.
2. Works well.
3. Has to be manually activated.


How can I:

1. Automate the batch file.
2. So that it starts doing its job, as soon as the USB cable is connected?


I am using:

1. Win XP Professional
2. SP 3
3. Fully updated


Cheers,
Mick

Discussion is locked

- Collapse -
Re: automate batchfile.
Sep 5, 2010 7:24AM PDT

Unless you installed a program called Autorun Eater (a safety measure!) simple put a correct autorun.inf file in the root folder of the USB-stick. It's the same principle as used on self-starting CD's.

http://www.phdcc.com/shellrun/autorun.htm contains an example. Googling AUTORUN.INF surely will find all the necessary info.

Kees

- Collapse -
No Dialog Box
Sep 5, 2010 7:54AM PDT

Hi Kees,

I disabled the dialog box ("Take No Action"), when connecting the external drive, some time ago.

How do I reinstate it?

Mick.

- Collapse -
Fixed "No Dialog Box"
Sep 5, 2010 9:29AM PDT

Hi Kees,

I have fixed the "No Dialog Box" problem, so I will explore your original suggestion.

Mick.