Copy Files by Month

Microsoft Windows server 2003 enterprise
September 23, 2009 at 09:27:36
Specs: Windows 2003
I need to create a batch file that scans a directory such as c:\temp for files for each month and moves them acording to that month to a folder labled that month. I looked at xcopy commands but I cannot get the date part right. Please help.

See More: Copy Files by Month

Report •


#1
September 23, 2009 at 09:55:40
Run this and post a few lines of the output.

=============================
@echo off & setLocal EnableDELAYedExpansion

for /f "tokens=* delims= " %%a in ('dir/b/a-d') do (
echo %%~Ta %%a
)


=====================================
Helping others achieve escape felicity

M2


Report •

#2
September 23, 2009 at 11:17:48
Thanks for the response. The script gave me a list of the files that were in the directory that I ran the script on. It listed the files with the date first [mm/dd/yyyy hh:mm am Filename]

Any thoughts? Thanks for all the help.


Report •

#3
September 23, 2009 at 11:25:54
The concept is to post the EXACT output so we know what we're dealing with.


=====================================
Helping others achieve escape felicity

M2


Report •

Related Solutions

#4
September 23, 2009 at 15:14:46
Sorry, I'm new at this. Here is what is says.

9/21/2009 12:41 AM desktop.ini
9/23/2009 06:00 PM test.bat


Report •


Ask Question