Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

forfiles command

Posted on 2013-06-03
3
Medium Priority
?
561 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 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

916 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