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!

Batch command to delete files days old 1

Status
Not open for further replies.

novice32

Programmer
Feb 27, 2010
3
0
0
US
I'm on Win.2003 attempting to delete files in a directory older than 7 days, but the command throws an error. Any thoughts? Below is the output from the command window.
---------------------------------------------
Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\Documents and Settings\admin>forfiles -p "C:\SQLBACKUP\DATAFILES\" -s -m *.*
-d -7 -c "cmd /c del @FILE"

ERROR: Invalid argument/option - '@FILE'.
Type "FORFILES /?" for usage.
 
Try without quotes around path
Code:
forfiles -p C:\SQLBACKUP\DATAFILES\ -s -m *.* -d -7 -c "cmd /c del @FILE"

===
Karlis
ECDL; MCSA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top