We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Deleting files in a single directory by their date

HarmonicMinor
on
Medium Priority
184 Views
Last Modified: 2010-05-02
How do I delete files from a specific directory that are older than 30 days?  I'm currently unable to browse this directory because it's size is almost 5Gb and the WinNT Server 4's browser stops responding when I try to view its contents.
Comment
Watch Question

Commented:
Did you try deleting them using command line
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
Deleting a specific range of files from a command prompt?  If the size of this directory wasn't so huge, it'd be easy to use XCOPY /D:3-08-04 to copy the files I want to keep and simply kill the directory contents.   I used this before in VB programs with much smaller directories.   Unfortunately, the server becomes unstable when simply accessing this directory.

Author

Commented:
zzzz', looks interesting.

I used DateDiff in the past and that looks like, if it's older than 30 days....goodbye!

I'll test it tomorrow morning.

Thx!

Author

Commented:
With some modifications, your code did what I wanted.

Thanks !
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.