Solved

forfiles command

Posted on 2013-06-03
3
543 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 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 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

776 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