Batch File

Discussion in 'Software' started by AirWarrior001, Mar 6, 2003.

  1. AirWarrior001

    AirWarrior001 Private E-2

    Hey guys, I'm trying to make a batch file that will back up a whole directory with subfolders included. As far as I know a batch file could look something like this:

    xcopy c:\directory\*.exe
    xcopy c:\directory\*.txt

    This batch will back up any file with a .exe or .txt file extension under the folder directory. But this one will only back up certain files. How would I back up all the subfolders within the directory?

    Any help will be appreciated!
     
  2. Major Attitude

    Major Attitude Co-Owner MajorGeeks.Com Staff Member

    Not sure if you your answer is this easy, but you can do a *.* for all files.

    Xcopy with /s will copy all directories and subdirectories, except empty ones. Using /e does the same including empty directories and subdirectories.

    Using /y will also overwrite files without asking you, handy if your backing up same files night after night.

    Example:

    xcopy c:\directory\*.* d:\whatever /e
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds