Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

forfiles command

Posted on 2013-06-03
3
Medium Priority
?
557 Views
Last Modified: 2013-06-03
i try to write someting that delete files and folder that old then 60 day
to delete files its work but i dont know what do add to delete the folders .
this is what i have run :

forfiles /P e:\folder /S /M *.* /D -60 /C "cmd /c del /q @path"

just what to add and where?
0
Comment
Question by:eranza84
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 22

Expert Comment

by:Haresh Nikumbh
ID: 39215709
Please refer below link where you will find sample script for delete folders older than 60 days


http://itknowledgeexchange.techtarget.com/itanswers/delete-x-days-files-and-folders/
0
 

Author Comment

by:eranza84
ID: 39215761
its the same
dont delete the folder just the files in the folders
0
 
LVL 26

Accepted Solution

by:
Leon Fester earned 2000 total points
ID: 39215872
forfiles /p "e:\folder" /c "cmd /c if @isdir==TRUE RMDIR /S /Q @path" /d -60

Open in new window


Posted by: Louis Nguyen  - 4/27/2011
See original post at the bottom of the following link:
http://technet.microsoft.com/en-us/library/cc753551(v=ws.10).aspx
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Organizations create, modify, and maintain huge amounts of data to help their businesses earn money and generally function.  Typically every network user within an organization has a bit of disk space to store in process items and personal files.   …
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question