Dos batch command delete old files




















Follow him on Telegram , Twitter , and YouTube. View all posts by Sergey Tkachenko. The solution using forfiles. Thus it is not really suitable for use in task scheduler. But it is not able to delete the file of subfolders.

Can you please give command to delete the files for subfolders as well. Your email address will not be published. Skip to content Advertisement. Contents hide. Support us Winaero greatly relies on your support. Excellent, Very nice work, Great help. Can you also share the command to do the same list or delete folders older then X days.

Leave a Reply Cancel reply Your email address will not be published. We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. Read More Do not sell my personal information. Close Privacy Overview This website uses cookies to improve your experience while you navigate through the website.

Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website.

These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience. Necessary Necessary. Quick links. How to delete files older than 7 days using a BAT file Discussion forum for all Windows batch related topics.

How to delete files older than 7 days using a BAT file 1 Post by abhishekkumarrai3 » Tue Oct 04, am Hi All, i have to delete files older than 7 days using a BAT file, i have used below command but this command is deleting all files, but i want it should delete files older than 7 days. Please remember to be considerate of other members. All submitted content is subject to our Terms Of Use. This will run on a schedule and will not require human interaction to input any data.

My problem is, I am not good at writing batch files. I can do the basic type stuff, but finding dates and doing date comparison is beyond me. This batch file will need to check the current date and then compare this date with the file date. If a file is found to be greater than, say, 3 months old then delete that file, then go to the next file and repeat the process until the end of file is reached. Is anyone out there good with writing DOS batch files and can give me some help on this?

If you can also recommend a good free online site where I can go to understand the syntax of finding the file date and how to compare dates? I have found several tutorials but they do not touch on dates. Share Flag. All Answers. Collapse -.



0コメント

  • 1000 / 1000