Copy USB Drive Contents

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
spporter
Newbie
Posts: 1
Joined: Fri Oct 20, 2006 1:36 pm

Copy USB Drive Contents

Post by spporter » Fri Oct 20, 2006 1:46 pm

Hi guys,
I'm totally new to this stuff so bare with me. I would like to create a program that runs as soon as as a USB Removable Storage Device is plugged in. I would like it to copy the contents of this device to a folder I designate. Any ideas on this would be great as I have no idea where to start. :?

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Oct 20, 2006 2:05 pm

Start off with a loop that looks for a specific "status" file on the USB drive.

If the "status" file on the USB drive indicates that new files exist then:
.....Do the copy process from USB to folder.
.....Change the status file on the USB to indicate no new files exist.
.....Display message "Copy Successful, remove USB"
.....Return to loop.
Else
.....If Drive exists:
..........Display message "Nothing To Copy, Remove USB"
..........Return to loop.
.....If Drive does not exist
..........Display no message
..........Return to loop
========================
Put a short Wait> in the loop so processor time is not hijacked.

When changing files on the USB, change the "status" file to NEW so it will copy files the next time it is plugged in.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts