Vb net delete files older than x days
I'm sure there are plenty of examples of this exact thing on the internet. My free. Jan 7th, , AM 3. Re: Delete files in directory older than 7 days Do you have any examples or links to examples?
Jan 7th, , AM 4. Re: Delete files in directory older than 7 days Code:. Net Tutorial. Jan 7th, , AM 5. Re: Delete files in directory older than 7 days Great! Jan 7th, , AM 6. Re: Delete files in directory older than 7 days Quite easy, FileInfo has a extension property. So: Code:. Jan 7th, , AM 7. Re: Delete files in directory older than 7 days This works great! Jan 7th, , AM 8.
Jan 7th, , AM 9. Nov 17th, , PM View Profile View Forum Posts. Re: [RESOLVED] Delete files in directory older than 7 days I was wondering if its possible to change the code here and instead of deleting it, I was wondering if its possible to copy it somewhere else? So when you are subtracting the dates that has difference less than one day the Days property of the result is 0, i.
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. Trying to delete files older than x days vb.
Asked 9 years, 11 months ago. Active 6 years, 4 months ago. Viewed 10k times. DirectoryInfo filePath. Delete Next filePath is the directory where the files reside. A Smith A Smith 1 1 gold badge 4 4 silver badges 10 10 bronze badges. Add a comment. Active Oldest Votes. The difference between the dates is less than a day.
Dim lDays As Long. Dim ds As Date. If hFile Then. Call CloseHandle hFile. Print "CheckFileDate: Unable to open file". Exit Function. End If. End Function. Jul 22nd, , PM 5. All times are GMT The time now is PM. If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.
0コメント