Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Batch file to copy files from C drive to USB

01 Aug 2013   #11
tys

Windows 7 Professional x64
 
 

sorry, yes, automatically.


My System SpecsSystem Spec
.
01 Aug 2013   #12
x BlueRobot

 

Code:
@echo off
:start
XCOPY "<Source Path>" "<Destination Path>" /f 
TIMEOUT /t 3600 /nobreak
goto start
The batch file should just copy and overwrite the old backup file with the new backup file without waiting for your response, I've left the /f switch so you know which files are being copied.
My System SpecsSystem Spec
05 Aug 2013   #13
tys

Windows 7 Professional x64
 
 

Thanks!

Nearly there, but it still asks me for "(YES/NO/ALL)". Is there a way to get this script to work automatically without running a Scheduled Task?
My System SpecsSystem Spec
.

05 Aug 2013   #14
x BlueRobot

 

Code:
@echo off
:start
COPY "<Source Path>" "<Destination Path>"
TIMEOUT /t 3600 /nobreak
goto start
I've just tried the batch file out now, and it doesn't prompt for anything, the only problem with COPY command is that it doesn't sub directories I believe.
My System SpecsSystem Spec
07 Aug 2013   #15
tys

Windows 7 Professional x64
 
 

Yup. lovely it works.


Is there an add-on to this which enables files to be deleted, lets say older than a week?

Thanks!
My System SpecsSystem Spec
07 Aug 2013   #16
x BlueRobot

 

Code:
@echo off
DEL [[drive:][path]filename
You wouldn't able to use the Timeout command for a week though, since the command is limited to 99999 seconds, which if I worked it out correctly, is 27 hours.

You would have to create a different batch file, since I don't see how it could be added to the existing batch file without being added to the loop, which would mean your backups would be saved and then deleted every hour.

With the above command, at least you wouldn't have to go searching for the backups.
My System SpecsSystem Spec
Reply

 Batch file to copy files from C drive to USB




Thread Tools




Similar help and support threads
Thread Forum
Windows7 Batch File Copy Possible?
Fellow Forum Members, I have two external hard drives I'm calling Hard Drive A and Hard Drive B. Hard Drive A & B are mounted to external USB cradles. Both USB cradles are connected to the same PC containing Hard Drive C. My objective is to transfer all data files, folders, sub folders from both...
Performance & Maintenance
How to copy a file from 1 pc to another pc in network using batch file
Help me make a batch file that copies a file from one computer to another computer in a network... PC1 = Source PC2 = Destination I want to copy a file from PC1's Drive E: to PC2's Drive E:
General Discussion
search multiple files, copy+paste to new folder (batch file software?)
I am a complete newbie when it comes to batch files and batch file software, so apologies in advance. I've done some research on Google etc but I seem to just be getting more and more confused trying to use various different scripts and programs and reading different info on various websites. ...
General Discussion
a simple batch file for copy files and folders
I want to write a batch file that do this for me: - makes a directory with the "yy.mm.dd.hh.mm" as the directory name, - copies files and folders from a TEST directory to above destination, - copies only new (or modified) files from the TEST directory to a separate folder. Any Idea?
General Discussion
Batch file or Exe to copy & rename directory and update files
I require a batch file or free utility that i can redistribute from my web site to other users, (gamers) that will copy the contents of a directory inside their game to a new location and re-name the directory at the same time. Something like this; Copy "Genesis\Vehicles\truck\diesel\4tonbaker"...
General Discussion
batch file to copy from virtual machine to USB
If C:\ is the root of the virtual machine and U:\ is the USB stick, I can PERFORM "copy C:\folder\** U:\folder", but that line in a batch file does not work. How can I fix that ?
Virtualization


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 06:06.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App