473,382 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Delete files in folder based on modified date.

Let's say I have the following folder:
C:\Archive\Data\Logs\

and within this folder are many files in this format:
Cycle Run of Tuesday, February 01, 2005.html
Cycle Run of Wednesday, February 02, 2005.html
..
..
..
Cycle Run of Monday, February 28, 2005.html
The folder gets larger every day when a new file is created. What I
want to do is setup an application that would delete all the previous
month's files. I would setup an executable to run off a PC as a
'Scheduled Task' on the 28th of every month to delete the previous
month's files. So, example on the 28th of March it would delete all the
files that were created in February. I guess you would somehow use the
'Modified Date'?

Nov 21 '05 #1
0 1202

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Raj | last post by:
Hi all, Can anyone help me with a script which would delete files or move them to a different folder at some scheduled time..! Please.....!!! Thanks in advance...
2
by: Robizzle | last post by:
I'm working on a very simple script that logs the ip address, time of hit, and os/browser information and currently it works every time. The problem is getting the script included into my html...
0
by: nek | last post by:
Greetings, I am running DB2 WSE V8.1, FP5 on W2K. The problem is not directly related to DB2 but as part of job, I need to manipulate files coming in from all sources. Under a main folder,...
3
by: richardkreidl | last post by:
I have the following module that I delete old files based on how old they are: Sub Main() Dim First_Date As String = Date.Today.AddDays(-7) Dim Archive_Files() As String =...
1
by: rdemyan | last post by:
I'm using DIR to loop through files in a folder and it's working fine. But can I control the order of the looping. For example, the first file would be the file with the most recent Date Modified...
4
by: viper888 | last post by:
Hi to all, I'm the newly appointed network administrator in our office, and upon scanning all the PCs that are connected to the network, (by the way we're using a windows 2000 server) almost all...
2
by: Thomas Bauer | last post by:
Hello, Call DeleteFiles bgW_DeleteFilesProcess = new DeleteFiles(); bgW_DeleteFilesProcess.RunAsync( folder, 5, "*.txt", new RunWorkerCompletedEventHandler( RunWorkerCompleted_DeleteFiles_TXT )...
9
by: LucasLondon | last post by:
Hi, Sorry, this is a bit of a lengthy one but I guess too much information is better than less! I have an excel worksheet that I update regulary with latest values from downloaded CSV files....
3
by: testperl | last post by:
Can anyone help me to make a perl script that could delete 1 week old files based on the date created? I made a folder: (August 16, 2008 to September 1, 2008) 08-16-08 08-17-08 08-18-08...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.