Computing.Net > Forums > Programming > waiting batch file ???

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

waiting batch file ???

Reply to Message Icon

Name: batchboy
Date: January 5, 2008 at 15:38:56 Pacific
OS: win xp
CPU/Ram: 2.2 Ghz Duo 2 GB ram
Product: Dv9000 Pavilion HP
Comment:

Is it possible to code a batch file that will wait in the background or something like that, and when a usb is plugged in, it uploads data onto that usb??




Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: January 5, 2008 at 18:11:09 Pacific
Reply:

Yeah probably, unless by "wait in the background" you mean "hide while waiting," in which case, probably not.


0

Response Number 2
Name: klint
Date: January 6, 2008 at 12:38:20 Pacific
Reply:

I understand the "proper" way to do it is not to have a running batch file that sits and waits, but to use a removable drive insertion handler (or whatever its proper name is) that automatically runs your batch file (or any other program) whenever the USB drive is plugged in.

I'm not sure of the details - you'll have to google for them yourself. But what I mean is, when you insert your USB drive, you often get a dialog box asking what you want to do: launch Explorer, download pictures, copy files, or nothing? Well, in that dialog box you can register your own application (probably through the Registry, but not sure how.) The advantage of that is you don't have a batch file running all the time when you don't need it, eating up memory and CPU time, but instead you have it run exactly when you want it to.


0

Response Number 3
Name: tonysathre
Date: January 7, 2008 at 05:09:40 Pacific
Reply:

If you have a U3 flash drive, you could use an autorun.inf file to call your script.

"Computer security." — Oxymoron


0

Response Number 4
Name: klint
Date: January 7, 2008 at 05:46:38 Pacific
Reply:

Tony: Good suggestion. I hate U3 drives or any other kind of smart drive, but fortunately I think the autorun.inf should work on ordinary drives too.


0

Response Number 5
Name: JRell
Date: January 7, 2008 at 12:32:36 Pacific
Reply:

It's not too bad... I use a tool to move my digital photos when I mount my memory card or direct attach a camera (that mounts as a disk drive) called DIM - Digital Image Mover. Here are the instructions to do just what you ask, but for his application.. just substitute your batch file for his app:

http://www.alanlight.com/dim/DIMAut...



0

Related Posts

See More



Response Number 6
Name: tonysathre
Date: January 7, 2008 at 13:42:48 Pacific
Reply:

An autorun.inf is more portable than having to install software to get it to work. I'd go that route, but that's just me.

"Computer security." — Oxymoron


0

Response Number 7
Name: Razor2.3
Date: January 7, 2008 at 18:37:58 Pacific
Reply:

I don't know. Autorun.inf might be only slightly more portable. Autorun on USB is disabled by default on Win2K down, and WinXP/Vista will ask you if you want to run the autorun.inf.


0

Response Number 8
Name: wille
Date: January 19, 2008 at 03:31:14 Pacific
Reply:

maybe you could use this, I'm not saying it's a good solution but have worked every time I've had to use such a program;
echo off
color a
:1
cls
if exist F: (
start F:
cls
exit
)
goto 1
because then it'll check if the F: drive exists over and over again untill it does!
And then you could compile it to an executable as a ghost app.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: waiting batch file ???

Waiting between batch files www.computing.net/answers/programming/waiting-between-batch-files/18845.html

Doing a Wait in Batch File www.computing.net/answers/programming/doing-a-wait-in-batch-file/19970.html

Batch Files www.computing.net/answers/programming/batch-files/14618.html