Delete folders older than x days windows batch




















On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. 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. I suggest you put the above command into a. Since RMDIR won't delete folders that aren't empty so I also ended up using this code to delete the files that were over 10 days and then the folders that were over 10 days old.

If you want using it with parameter ie. In this case you can call your batch file from any location I suppose UNC path should work, too. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Batch file to delete folders older than 10 days in Windows 7 Ask Question.

Asked 10 years, 9 months ago. Active 8 years, 10 months ago. Viewed k times. I want to create a batch file which should delete all subfolders of a folder which are older than 10 days, using Windows 7 Any help would be appreciated.

Awesome PC Accessories. Best Linux Laptops. Best Wireless iPhone Earbuds. Best Bluetooth Trackers. Best eReaders. Best VPN. Browse All News Articles. Windows 11 Uninstall Clock. Teams Walkie-Talkie.

PCI Express 6. Wordle Scams. T-Mobile iCloud Private Relay. Avira Antivirus Crypto Miner. Linux PinePhone Pro. Google Green Messages. Use Your iPhone as a Webcam. Hide Private Photos on iPhone. All Microsoft's PowerToys for Windows. Take Screenshot by Tapping Back of iPhone.



0コメント

  • 1000 / 1000