Computing.Net > Forums > Programming > Batch file date time select files

Batch file date time select files

Reply to Message Icon

Original Message
Name: Ebrook
Date: May 1, 2007 at 07:49:48 Pacific
Subject: Batch file date time select files
OS: Win2k
CPU/Ram: 2Gb
Model/Manufacturer: HP
Comment:

Hi All,

I'm trying to find a way to write a batch file that will copy files created in a given month to a seperate directory for ftping offsite. I've been looking at using a combination of dir and find but I can not seem to get them to work for a given month.

Any suggestions would be most appreciated!

Regards,

Edward



Report Offensive Message For Removal

Response Number 1
Name: Mechanix2Go
Date: May 2, 2007 at 01:37:23 Pacific
Subject: Batch file date time select files
Reply: (edit)

::==
@echo off
setLocal EnableDelayedExpansion

for /f "tokens=4 delims= " %%a in ('dir /a-d/tc ^|find "-05-2007"') do (
echo copy %%a z:\outbox\
)
::==



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

M2



Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Batch file date time select files

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software