Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8695

Re: Delete Subfolders older than x Days

$
0
0

Hi Dsya,

 

I am trying to delete folders in a network location.  The job processes flat files,  creates a timestamped subfolder in an archive directory,  and moves the processed flat files into this new subfolder.

 

Before the job finishes,  I want it to go through the archive directory and delete any sub folders that are older than a certain amount of days.  That number of days will be passed to the job through a global variable.

 

I have found a way to get a script to create a text file containing the names of all the sub folders.  Is there a way to write a script that will read these names from the text file,  compare the time stamp in the name to the day variable,  and then delete the folder if it is old enough?

 

Or maybe another way to delete these folders without using the text file?

 

Thanks,

Tony


Viewing all articles
Browse latest Browse all 8695

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>