Solved

forfiles command

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

821 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