Solved Looking for a Script to delete files with logging

August 18, 2012 at 07:54:57
Specs: Windows Vista
I need to delete some files on a number of servers based on date and naming convention. It needs to create a log for auditing purposes as well. Any body got anything?

See More: Looking for a Script to delete files with logging

Report •

August 19, 2012 at 01:46:29
Date math in script is messy business. Post the output of this:

:: ===== script starts here ===============
:: compare dates
:: dcomp.bat 2012-08-19 15:30:56.79
@echo off > newfile & setLocal enableDELAYedeXpansioN

for /f "tokens=* delims= " %%a in ('dir/b') do (
call :sub1
goto :eof

for /f "tokens=* delims= " %%i in ('dir/b newfile') do (
goto :eof
::====== script ends here =================

Life is too important to be taken seriously.


Report •

August 20, 2012 at 09:13:35
Vista has FORFILES I believe.


Report •

August 25, 2012 at 08:36:54
✔ Best Answer
I have a script that can be download. It uses windows scripting host to act more like an application.

-You can Archive files for x number of days prior to deletion.. or just move them.
-You can specify multiple directories to be scanned directory with custom rules to look for per directory
- find names using Regex expressions and age of files in days

You can download the code at

It unzips with an example directory junk files that it deletes so you can play with it and configure it. It also has documentation

Report •

Related Solutions

August 25, 2012 at 08:53:27
Holy cow... this is exactly what I was looking for and I didn't have to modify it - accept for setting up the jobs to look for my junk. Thank you, Thank you, Thank you for the code.

In fact I think I may have another use for it. Can you set this up to recursively look in folders? :) For that kind of functionality I'll even click on a few ads as well :)

Report •

Ask Question