Solved

forfiles command

Posted on 2013-06-03
3
534 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
3 Comments
 
LVL 21

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 500 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Preface Having the need * to contact many different companies with different infrastructures * do remote maintenance in their network required us to implement a more flexible routing solution. As RAS, PPTP, L2TP and VPN Client connections are no…
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now