TechSpot

Copying files from hard drive to USB

By stanko1610
Aug 16, 2009
  1. How can I make USB automatically, when inserted, copy desired content to USB using only autorun.ini and .bat files?
    For an example: When I plug USB, i want to automatically start copy in background D:\Pictures to USB.
     
  2. strategic

    strategic TechSpot Paladin Posts: 1,274

    I'll assume you know how to create the batch file, make sure that batch file is on the USB drive, most USB drives have an option to run a file when inserted (my Sandisk Cruzer does), select the batch file and you should be all set.
     
  3. stanko1610

    stanko1610 TS Rookie Topic Starter

    But what should I write in that batch file? Thanks
     
  4. strategic

    strategic TechSpot Paladin Posts: 1,274

    OK, to create the batch file, simply create a text document which you will save as a "whatever.bat"

    The batch file will look like this:

    copy d:\pictures\*.* f:\

    D:\pictures is the 'from' directory, f:\ is the 'to' directory (you'll need to substitute for the correct drive letter). This won't work if you're copying the same content to multiple drives however, in that case, the batch file would need to be on your HDD, and you would have to run it manually everytime you insert a usb stick.;)
     
  5. jobeard

    jobeard TS Ambassador Posts: 13,516   +336

    for your personal system, the autorun may work well for you.

    As a general solution to copy from any system to which the device is attached,
    this will not be 100% successful. GPO policies can disable all autorun features and
    there are means to disable the USB for either read, write, or both for security reasons.
     
Topic Status:
Not open for further replies.


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.