Sort files into subfolders named by the month

August 10, 2009 at 03:16:50
Specs: N/A
Could anyone help me to find a solution for the next:

I have a folder named C:\FAXES. There are a lot of files there, which I want to be sorted in subfolders named by the month of their creation. I mean, if there would be found files created on August 2009, the script should create folder C:\FAXES\08-2009, and move all the files created on August there. The script should create subfolders only for those months, the files has in their creation date. I mean, if there no files created on June, subfolder 06-2009 should not be created.

Well, I'm only beginner in batch programming... and I would be very, very pleased if someone help me with the thing I need, or point me to any kind of info that may be helpful for me.


See More: Sort files into subfolders named by the month

Report •


#1
August 10, 2009 at 05:48:31
First you need to get clear about the OS.


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

M2


Report •

#2
August 10, 2009 at 06:08:58
I use Windows 2003 Server with Resource Kit installed

Report •

#3
August 10, 2009 at 08:59:41
Next you need to paste in the output of dir, like this:

10-08-09 22:54 915 MULT.D10
1 File(s) 915 bytes
0 Dir(s) 469,876,736 bytes free


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

M2


Report •

Related Solutions

#4
August 11, 2009 at 00:41:18
Well, I found the proper solution. Thank you in anyway!

--- cut ---
@echo off
if "%1"=="" goto start
set d=%1
set e=%d:~-7%
if not exist D:\FAX\%e% mkdir D:\FAX\%e%
move %2 D:\FAX\%e%
goto :eof
:start
forfiles -p D:\FAX -m *.tif -c "cmd /c call C:\ADMINS~1\PLATZ-~2.BAT @FDATE @PATH"
:eof


Report •


Ask Question