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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch File

Status
Not open for further replies.

timwilliams77

IS-IT--Management
Jul 9, 2007
19
GB
Hi

I have two files which I require a batch command to carry out the following:

1) Copy both files
2) Move to orignal files
3) Rename to copied files

a) File location is users\timw\desktop\trinity local\trinity\projects\admin re\aviva\development\alpha\stats and trend

b) files to be copied are - Aviva Programme Defect Daily Statistics 16092009.pptx & Aviva Programme Defect Daily Statistics 16092009.ppsx (a wild card would be best as the date is different each day)

c)Move two original files to users\timw\desktop\trinity local\trinity\projects\admin re\aviva\development\alpha\stats and trend\archive

d) rename the two new files to include todays date

Hope you can help?

Tim

 
Hi

I have tried -

cd\users\timw\desktop\trinity local\trinity\projects\admin re\development\alpha\stats and trend

This works ok

copy aviva*.ppsx

This fails saying cannot find file specified
 
I have got it to copy the 2 files and add the date stamp onto the new ones, great....

How do I move the two original files to a different location?

set timestamp=%DATE%
set timestamp=%timestamp:/=-%
copy aviva*ppsx Aviva Programme Daily Defect Statistics %timestamp%.ppsx
copy aviva*pptx Aviva Programme Daily Defect Statistics %timestamp%.pptx


 
If the file is unique, I'd not use the *

Code:
copy "Aviva Programme Daily Defect Statistics.ppsx" "Aviva Programme Daily Defect Statistics %timestamp%.ppsx"
copy "Aviva Programme Daily Defect Statistics.pptx" "Aviva Programme Daily Defect Statistics %timestamp%.pptx"

Cheers,
Dian
 
It will be each morning, so yes it will be unique and will be the one with yesterdays time stamp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top