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

ForFiles.exe question [ Batch ]

Status
Not open for further replies.

0318

Programmer
Jan 18, 2004
25
0
0
NL
hi ppl
i have to use forfiles, to copy files older then 7 days to another folder.
here is what i use

forfiles -pc:\temp -s -d-7 -c"cmd /c copy ""@FILE"" /Q /F c:\temp3":

in the directory c:\temp files older then 7 days copy to c:\temp3

doesnt work, it allways says: cant copy the file onto itself :S
someone.?
 
0318,

I do not use forfiles. But if you insist, try this.
Code:
forfiles -pc:\temp -s -m*.* -d-7 -c"cmd /c copy @FILE /Q /F c:\temp3"
c:\temp and c:\temp3 must be _existing_ folders.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top