Create Windows Batch Files to Purge Old Folders and Old Data
$10-30 USD
Terminado
Publicado hace más de 10 años
$10-30 USD
Pagado a la entrega
We need two windows batch files to be developed that will purge old folders, and old data.
Script 1: Script 1 will take as input a parameter that will indicate a list of folder paths: For example:
[login to view URL] “F:\CLIENT\XML_OUT, F:\CLIENT\EXCEPTION, F:\POST”
The script will evaluate each sub folder within the folder paths passed, and will remove any subfolders with a date older than five (5) days from the date and time the script was executed.
Script 2: Script 1 will take as input a parameter that will indicate a list of folder paths: For example:
[login to view URL] “G:\Navaera On Demand\data\ENVIEW_HOME\EVT_OUT, G:\Navaera On Demand\data\ENVIEW_HOME\LOGS”
The script will evaluate each file within the folder paths passed, and will remove any files with a date older than five (5) days from the date and time the script was executed.
Hi!
I've written the script for the second case.
The problem in your request is that it's hard to parse input parameters.
I suggest to use the name of file as input parameter and you will specify the list of folders in it one per line.
Works like a charm!
Have a look:
[login to view URL]
::------code-----
@echo off
for /f %%i in ([login to view URL]) do (
echo "Cleaning %%i..."
Forfiles -p %%i -s -m *.* -d -5 -c "cmd /c del /q @path"
)
[login to view URL]
r:\temp\deletefiles\testfiles
r:\temp\deletefiles\testfiles2
r:\temp\deletefiles\testfiles3
I'll send you the second one after milestone be released.
Thanks!