Discussion:
delete files older than...
(too old to reply)
Hugo
2007-10-26 13:18:05 UTC
Permalink
Hi everyone !

What tool can I use to delete files older than a specified number of days
(on command line)?

Thank you !

Hugo
Pegasus (MVP)
2007-10-26 14:17:19 UTC
Permalink
Post by Hugo
Hi everyone !
What tool can I use to delete files older than a specified number of days
(on command line)?
Thank you !
Hugo
xxcopy.exe, using the /db and the /L switches.
Lanwench [MVP - Exchange]
2007-10-26 16:03:34 UTC
Permalink
Post by Hugo
Hi everyone !
What tool can I use to delete files older than a specified number of
days (on command line)?
Thank you !
Hugo
another option-

Forfiles -p "<path>" -s -m *.* -d -10 -c "Cmd /C del @FILE"

(all files older than 10 days)
Pegasus (MVP)
2007-10-26 16:42:51 UTC
Permalink
"Lanwench [MVP - Exchange]"
Post by Lanwench [MVP - Exchange]
Post by Hugo
Hi everyone !
What tool can I use to delete files older than a specified number of
days (on command line)?
Thank you !
Hugo
another option-
(all files older than 10 days)
Congratulations! You must be one of a very small group
of people able to make sense of the syntax rules of the
forfiles.exe command. :-)
Lanwench [MVP - Exchange]
2007-10-26 17:40:51 UTC
Permalink
Post by Pegasus (MVP)
"Lanwench [MVP - Exchange]"
Post by Lanwench [MVP - Exchange]
Post by Hugo
Hi everyone !
What tool can I use to delete files older than a specified number of
days (on command line)?
Thank you !
Hugo
another option-
(all files older than 10 days)
Congratulations! You must be one of a very small group
of people able to make sense of the syntax rules of the
forfiles.exe command. :-)
Make sense of 'em? Sure, the important ones. I know a lot of really smart
people and I often steal^H^H^H borrow batch files from them for my own use.
I can generally figure out what the parameters do once I see them working -
but this isn't my area. I'm just a magpie, and the world is full of shiny
objects. ;-)
Ken Zhao [MSFT]
2007-10-29 01:40:42 UTC
Permalink
Hello Hugo,

Thank you for using newsgroup and thanks Pegasus and Lanwench's great
information sharing with us.

Thanks & Regards,

Ken Zhao

Microsoft Online Support
Microsoft Global Technical Support Center

Get Secure! - www.microsoft.com/security <http://www.microsoft.com/security>
====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Hugo
2007-10-30 18:37:43 UTC
Permalink
Thank you !

Forfiles do a great job !

Hugo

"Lanwench [MVP - Exchange]"
Post by Lanwench [MVP - Exchange]
Post by Hugo
Hi everyone !
What tool can I use to delete files older than a specified number of
days (on command line)?
Thank you !
Hugo
another option-
(all files older than 10 days)
Lang Du
2007-12-04 14:44:01 UTC
Permalink
I am using Window XP pro. How could I get forfiles command ? Where should I
download it ?
Thank you.
David Brown
2007-12-05 21:50:31 UTC
Permalink
Hello Lang,

Never heard of forfiles, but a quick search shows that it's part of the MS
2000 resource kit.

You can download the reskit here:
http://www.petri.co.il/download_free_reskit_tools.htm

It's amazing what you can do in two minutes with Google.
Post by Lang Du
I am using Window XP pro. How could I get forfiles command ? Where should I
download it ?
Thank you.
Lang Du
2007-12-06 10:53:04 UTC
Permalink
Thank David,
It works. However, I found a link
http://technet2.microsoft.com/windowsserver/en/library/9660fea1-65c7-48cf-b466-204ba159381e1033.mspx?mfr=true
which has different syntax with yours. Do you have any idea ? Why I cannot
find any forfiles.exe downloads from MS web server ?

Thank you.
Post by David Brown
Hello Lang,
Never heard of forfiles, but a quick search shows that it's part of the MS
2000 resource kit.
http://www.petri.co.il/download_free_reskit_tools.htm
It's amazing what you can do in two minutes with Google.
Post by Lang Du
I am using Window XP pro. How could I get forfiles command ? Where should I
download it ?
Thank you.
David Brown
2007-12-11 19:47:03 UTC
Permalink
Hello Lang,

Not sure. I didn't find one at MS either. Maybe it's old enough to be unsupported
and they've offloaded or abandoned it, or it's quietly being killed.

That may be another reason to learn to use Robocopy or the "/f" option of
the "FOR" command built into DOS.
Post by Lang Du
Thank David,
It works. However, I found a link
http://technet2.microsoft.com/windowsserver/en/library/9660fea1-65c7-4
8cf-b466-204ba159381e1033.mspx?mfr=true
which has different syntax with yours. Do you have any idea ? Why I cannot
find any forfiles.exe downloads from MS web server ?
Thank you.
Post by David Brown
Hello Lang,
Never heard of forfiles, but a quick search shows that it's part of
the MS 2000 resource kit.
http://www.petri.co.il/download_free_reskit_tools.htm
It's amazing what you can do in two minutes with Google.
Post by Lang Du
I am using Window XP pro. How could I get forfiles command ? Where should I
download it ?
Thank you.
Sarah Lou
2008-09-27 10:24:32 UTC
Permalink
Post by Lanwench [MVP - Exchange]
Post by Hugo
Hi everyone
What tool can I use to delete files older than a specified number o
days (on command line)
Thank you
Hug
another option
(all files older than 10 days
I found a really helpful post on using forfiles and all the switche
here

http://www.jjclements.co.uk/index.php/2008/07/31/delete-files-older-than-certain-number-of-day

Could be worth checking out I thin

--
Sarah Lo
-----------------------------------------------------------------------
Sarah Lou's Profile: http://forums.techarena.in/members/sarah-lou.ht
View this thread: http://forums.techarena.in/windows-server-help/839803.ht

http://forums.techarena.i
shruthy
2010-05-21 09:48:01 UTC
Permalink
Hi. I am using the following script to delete .bak from a a director
which are older than 3 days.

Forfiles -p "<path>" -s -m *.* -d -3 -c "Cmd /C del @FILE"

the script works absolutely fine with Windows Vista. But it does no
work on XP.

forfiles.exe was missing in C:\Windows\System32. So I included the fil
in the directory.

Still does not work.

Can anyone kindly guide me....

Thanks a to

--
shruth
-----------------------------------------------------------------------
shruthy's Profile: http://forums.techarena.in/members/222814.ht
View this thread: http://forums.techarena.in/windows-server-help/839803.ht

http://forums.techarena.i
Sea Cali
2010-12-08 22:20:41 UTC
Permalink
FileGrooming.exe is a command line utility where you can specify the number of days and if you would like to delete them, archive, archive & move, or simply move the files. It also does logging so you can track where all of your files go.

You can either google the creation corner, click on my homepage or email me and I'll get it to ya.
Post by Hugo
Hi everyone !
What tool can I use to delete files older than a specified number of days
(on command line)?
Thank you !
Hugo
Post by Pegasus (MVP)
xxcopy.exe, using the /db and the /L switches.
Post by Lanwench [MVP - Exchange]
another option-
(all files older than 10 days)
Post by Pegasus (MVP)
"Lanwench [MVP - Exchange]"
Congratulations! You must be one of a very small group
of people able to make sense of the syntax rules of the
forfiles.exe command. :-)
Post by Lanwench [MVP - Exchange]
Make sense of 'em? Sure, the important ones. I know a lot of really smart
people and I often steal^H^H^H borrow batch files from them for my own use.
I can generally figure out what the parameters do once I see them working -
but this isn't my area. I'm just a magpie, and the world is full of shiny
objects. ;-)
Post by Ken Zhao [MSFT]
Hello Hugo,
Thank you for using newsgroup and thanks Pegasus and Lanwench's great
information sharing with us.
Thanks & Regards,
Ken Zhao
Microsoft Online Support
Microsoft Global Technical Support Center
Get Secure! - www.microsoft.com/security <http://www.microsoft.com/security>
====================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Hugo
Thank you !
Forfiles do a great job !
Hugo
"Lanwench [MVP - Exchange]"
Post by Lang Du
I am using Window XP pro. How could I get forfiles command ? Where should I
download it ?
Thank you.
Post by Lang Du
Thank David,
It works. However, I found a link
http://technet2.microsoft.com/windowsserver/en/library/9660fea1-65c7-48cf-b466-204ba159381e1033.mspx?mfr=true
which has different syntax with yours. Do you have any idea ? Why I cannot
find any forfiles.exe downloads from MS web server ?
Thank you.
I found a really helpful post on using forfiles and all the switches
http://www.jjclements.co.uk/index.php/2008/07/31/delete-files-older-than-certain-number-of-days
Could be worth checking out I think
--
Sarah Lou
------------------------------------------------------------------------
Sarah Lou's Profile: http://forums.techarena.in/members/sarah-lou.htm
View this thread: http://forums.techarena.in/windows-server-help/839803.htm
http://forums.techarena.in
Hi. I am using the following script to delete .bak from a a directory
which are older than 3 days.
the script works absolutely fine with Windows Vista. But it does not
work on XP.
forfiles.exe was missing in C:\Windows\System32. So I included the file
in the directory.
Still does not work.
Can anyone kindly guide me....
Thanks a ton
--
shruthy
------------------------------------------------------------------------
shruthy's Profile: http://forums.techarena.in/members/222814.htm
View this thread: http://forums.techarena.in/windows-server-help/839803.htm
http://forums.techarena.in
Submitted via EggHeadCafe
Microsoft ASP.NET For Beginners
http://www.eggheadcafe.com/training-topic-area/ASP-NET/7/ASP.aspx
Loading...