Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can I copy file to a folder

Status
Not open for further replies.

encata

MIS
Apr 9, 2002
100
0
0
ET
I have scheduled backup file (BK.bkf) overwritten daily.I want to copy this backup file to a folder. The folder is going to hold the daily backup files with different names,so that i will have 30 files at the end of the month.

can you help me with VB script or any other scripts to automate the job.

Thanks

Why you worry? Life is too short to worry.
 
Here's a solution I use for making backups of a certain file and placing a date stamp on it.

This is a batch file and run it nightly under scheduled tasks.

del "d:\shared\DD\ALL\Customer Tracking\BackupCopies\customer.xls"
rem the above line tests whether the file still exists prior to copying

COPY "d:\shared\DD\ALL\Customer Tracking\customer.xls" "d:\shared\DD\ALL\Customer Tracking\BackupCopies"

d:
cd\"shared\DD\ALL\Customer Tracking\BackupCopies"

RENAME customer.xls customer_%date:~4,2%-%date:~7,2%-%date:~10%.xls
 
KenDCFS
Thanks , I wanted such simple one

it works


PHV ,I am studyind the material as I am not good at scripting, Thanks a lot

Why you worry? Life is too short to worry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top