Computing.Net > Forums > Programming > Copy Files by Month

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.

Copy Files by Month

Reply to Message Icon

Name: Dev_Hawk
Date: September 23, 2009 at 09:27:36 Pacific
OS: Windows 2003
Product: Microsoft Windows server 2003 enterprise
Subcategory: Batch
Tags: batch, file copy, xcopy
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: September 23, 2009 at 09:55:40 Pacific
Reply:

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


0

Response Number 2
Name: Dev_Hawk
Date: September 23, 2009 at 11:17:48 Pacific
Reply:

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.


0

Response Number 3
Name: Mechanix2Go
Date: September 23, 2009 at 11:25:54 Pacific
Reply:

The concept is to post the EXACT output so we know what we're dealing with.


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

M2


0

Response Number 4
Name: Dev_Hawk
Date: September 23, 2009 at 15:14:46 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Logitech Keyboard Hotkeys... Login Script


Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Copy Files by Month

Copy files by date modified www.computing.net/answers/programming/copy-files-by-date-modified/15932.html

copy file where date is prev month www.computing.net/answers/programming/copy-file-where-date-is-prev-month/7477.html

batch copy file on Ping Errorlevel= www.computing.net/answers/programming/batch-copy-file-on-ping-errorlevel/18016.html