Results 1 to 1 of 1

Thread: How to make flash drive that copy's users files silently and automatically

  1. #1
    Administrator Kelly Bramble's Avatar
    Join Date
    Feb 2011
    Location
    Bold Springs, GA
    Posts
    1,935

    How to make flash drive that copy's users files silently and automatically

    flash.jpg

    This is the heart of the flash drive copy I am not going to go through every line of code here but if you have questions just ask or use Google, I will however touch on the main points of the code.

    Like the last step make sure you use word to make this file save it as file.bat and all files not a word file just like in the picture.
    Code follows

    --------------------------------------------------------------------------------
    @echo off
    :: variables
    /min
    SET odrive=%odrive:~0,2%
    set backupcmd=xcopy /s /c /d /e /h /i /r /y
    echo off
    %backupcmd% "%USERPROFILE%\pictures" "%drive%\all\My pics"
    %backupcmd% "%USERPROFILE%\Favorites" "%drive%\all\Favorites"
    %backupcmd% "%USERPROFILE%\videos" "%drive%\all\vids"
    @echo off
    cls

    --------------------------------------------------------------------------------
    what this code does:

    looks for what drive letter the flash drive is and sets it
    starts xcopy

    looks for current users pictures, favorites, and videos folder then copy's them to the found flash drive in folders my pics, favorites, and vids
    clears screen and shuts down window

    now the fun part of this code it can be changed to suit your needs say you need to copy say music folder the code would change to %backupcmd% "%USERPROFILE%\music" "%drive%\all\music"
    Last edited by Kelly Bramble; 06-03-2013 at 08:56 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •