list all the directories created 1month befor

Nikon Auto slide feeder (sf-200s) for ba...
July 30, 2009 at 23:45:28
Specs: Windows XP
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


See More: list all the directories created 1month befor

Report •


#1
July 30, 2009 at 23:49:28
thanks

Report •

#2
July 31, 2009 at 01:00:20
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


Report •

#3
July 31, 2009 at 04:04:41
I want to remove the folders which are more than 1 month old

Report •

Related Solutions

#4
July 31, 2009 at 05:24:50
We're defining a month as . . . what, exactly?

Report •

#5
July 31, 2009 at 05:29:17
Hi R2,

As ever, first step is the problem statement.


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

M2


Report •

#6
July 31, 2009 at 13:34:43
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%


Report •


Ask Question