1

Files get placed in a directory daily: myfile11515, myfile1243, myfileABC

Need to move them to a different directory on the same computer that has the month folders:

January February March etc.

I want it to read the created on date of the file to determine which month folder to put the file in.

The tricky part is that I want this to run and put the daily files in the month folder each month WITHOUT ever having to edit the batch file. So, some way to read the created by date each month.

3
  • Coming from which directory? Will the monthly directories be directly underneath the source directory? And, shall it select the monthly folder to use based on the date stamp of the file, or today's date? Please click on the 'edit' link above and to the left and put your answers in the body of th question, not here as a comment.
    – K7AAY
    Jan 15, 2015 at 18:45
  • Any experience with Powershell? Seems like it would do the job nicely.
    – rrirower
    Jan 15, 2015 at 20:38
  • And, to reward those of us who spend our time to provide answers, please click the checkmark at the left of the answer which works for you, so they gain more powers (such as Kryptonite Immunity and the ability to edit posts without approval).
    – K7AAY
    Jan 16, 2015 at 16:12

1 Answer 1

1

Make subdirectories named 01 through 12 under the source directory where the files land.

Make symlinks using MKLINK a la

MKLINK /D "C:\Users\<yourusername>\Documents\Monthlies\01" "M:\January"

then harvest today's date ith

FOR /F “TOKENS=1,2 eol=/ DELIMS=/ ” %%A IN (‘DATE/T’) DO SET mm=%%B

then copy the files in question from the source to C:\Users\\Documents\Monthlies\%%B which will also appear as M:\January .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .