Discussion:
Create new folder and move files based on creation date
(too old to reply)
dstiff
2008-02-19 16:53:02 UTC
Permalink
Hi Forum,

I am fairly new to scripting and am looking for a solution that will create
a new subfolder for each month and then move files into that folder from the
main folder based on the creation date. Ran on a daily basis.

i.e. - text.txt created 01-01-2008
(Create folder within c:\Folder\Date to January....then move all files
within c:\Folder\Date that were created from 01-01-2008 to 01-31-2008 to the
newly created folder.

Any assistance would be greatly appreciated.
McKirahan
2008-02-19 17:48:55 UTC
Permalink
Post by dstiff
Hi Forum,
I am fairly new to scripting and am looking for a solution that will create
a new subfolder for each month and then move files into that folder from the
main folder based on the creation date. Ran on a daily basis.
i.e. - text.txt created 01-01-2008
(Create folder within c:\Folder\Date to January....then move all files
within c:\Folder\Date that were created from 01-01-2008 to 01-31-2008 to the
newly created folder.
Will the January folder be called: C:\Folder\Date\January

Will files created in January of other years also be moved there too?

Perhaps you want C:\Folder\2008\January?
Al Dunbar
2008-02-22 04:32:12 UTC
Permalink
Post by dstiff
Post by dstiff
Hi Forum,
I am fairly new to scripting and am looking for a solution that will
create
Post by dstiff
a new subfolder for each month and then move files into that folder from
the
Post by dstiff
main folder based on the creation date. Ran on a daily basis.
i.e. - text.txt created 01-01-2008
(Create folder within c:\Folder\Date to January....then move all files
within c:\Folder\Date that were created from 01-01-2008 to 01-31-2008 to
the
Post by dstiff
newly created folder.
Will the January folder be called: C:\Folder\Date\January
Will files created in January of other years also be moved there too?
Perhaps you want C:\Folder\2008\January?
and when you move another file named text.txt into the same monthly
subfolder, do you want it to replace the older one of the same name, or do
you want its name changed somehow to avoid this?

/Al
new_to_the_game
2009-11-12 23:34:09 UTC
Permalink
Hello,

I have been looking to do exactly the same thing.

By year, by month.

So it would be
c:\folder\2009\November

etc...

Is this possible? Would you run this through a cron job once per month?


Hope you can help...
--
new_to_the_game
------------------------------------------------------------------------
new_to_the_game's Profile: http://forums.techarena.in/members/154276.htm
View this thread: http://forums.techarena.in/server-scripting/917087.htm

http://forums.techarena.in
Loading...