Computing.Net > Forums > Programming > list all the directories created 1month befor

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

list all the directories created 1month befor

Reply to Message Icon

Name: madhubatch
Date: July 30, 2009 at 23:45:28 Pacific
OS: Windows XP
Product: Nikon Auto slide feeder (sf-200s) for batch scanning super coolscan 40000
Subcategory: Batch
Comment:

I need a batch file which will get the directory list from a txt file and list out the directories which are created 1 month before


ex:
list.txt file will have the following

c:\program\123
c:\test\abc
d:\temp
c:\docs\x\asdf
e:\batch\test1
c:\temp\google

the batch file should read each line from the above txt and check if it is created 1 month ago, if so it will display (echo) the directory like

d:\temp
e:\batch\test1

above directories created 1 month ago



Sponsored Link
Ads by Google

Response Number 1
Name: madhubatch
Date: July 30, 2009 at 23:49:28 Pacific
Reply:

thanks


0

Response Number 2
Name: Mechanix2Go
Date: July 31, 2009 at 01:00:20 Pacific
Reply:

If you look around this forum you'll see that date math in batch is not a happy subject.

If you want to list dirs of previous month, maybe. If you want just those exactly one month old, probably hopeless.


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 3
Name: madhubatch
Date: July 31, 2009 at 04:04:41 Pacific
Reply:

I want to remove the folders which are more than 1 month old


0

Response Number 4
Name: Razor2.3
Date: July 31, 2009 at 05:24:50 Pacific
Reply:

We're defining a month as . . . what, exactly?


0

Response Number 5
Name: Mechanix2Go
Date: July 31, 2009 at 05:29:17 Pacific
Reply:

Hi R2,

As ever, first step is the problem statement.


=====================================
If at first you don't succeed, you're about average.

M2


0

Related Posts

See More



Response Number 6
Name: dtech10
Date: July 31, 2009 at 13:34:43 Pacific
Reply:

Hi Madhubatch

Post the output of this code and state wether your date format is dd/mm/yyyy or mm/dd/yyyy ect.
I already have a batch file to delete files a certain number of days old which I will try modify to del directories.

for /d %%a in (*.*) do echo %%a %%~ta %%~fa %date%


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: list all the directories created 1month befor

VB.NET list all the data from DB www.computing.net/answers/programming/vbnet-list-all-the-data-from-db/13109.html

How do u list all files on PC www.computing.net/answers/programming/how-do-u-list-all-files-on-pc/16965.html

list all files in a dir & subdir www.computing.net/answers/programming/list-all-files-in-a-dir-amp-subdir/14098.html