Copy Files dated yesterday

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
Can some one help on how to copy files from a source to destination that
have date stamp of previous day. Example: Copy C:\temp\*.dat J:\Arhive\*.dat
(option is to copy only files that are created yesterday. On 1st May it
should copy files dated 30th April. On 1st Jan, it should copy files created
31st December and so on...
 
Galop said:
Hello,
Can some one help on how to copy files from a source to destination
that have date stamp of previous day. Example: Copy C:\temp\*.dat
J:\Arhive\*.dat (option is to copy only files that are created
yesterday. On 1st May it should copy files dated 30th April. On 1st
Jan, it should copy files created 31st December and so on...


See the following for a generic approach to recursively selecting files for
processing. In your case, selecting files would be based on the extension
( fso.GetExtensionName(file.Name) ) and date (file.DateLastModified), and
the copying (file.Copy) ...

Google Groups : microsoft.public.scripting.wsh
http://groups-beta.google.com/group/microsoft.public.scripting.wsh/msg/666802cc98068a6c
 
Hello,
Can some one help on how to copy files from a source to destination that
have date stamp of previous day. Example: Copy C:\temp\*.dat J:\Arhive\*.dat
(option is to copy only files that are created yesterday. On 1st May it
should copy files dated 30th April. On 1st Jan, it should copy files created
31st December and so on...

FORFILES.EXE from the Resource Kit (untested):
FORFILES -d-1 -mC:\temp\*.dat -c"CMD COPY $FILE J:\Arhive\"

or using 4DOS/4NT's Date Ranges:
COPY /[d-1,+0] C:\temp\*.dat J:\Arhive\
 
FORFILES.EXE from the Resource Kit (untested):
FORFILES -d-1 -mC:\temp\*.dat -c"CMD COPY $FILE J:\Arhive\"

FYI - FORFILES is part of the Windows Server 2003 Administration Tools
Pack...

Both the Windows Server 2003 Administration Tools Pack and the Resource Kit
Tools can be downloaded and installed on XP (see System requirements for
each)...

Download details: Windows Server 2003 Administration Tools Pack
http://www.microsoft.com/downloads/...15-c8f4-47ef-a1e4-a8dcbacff8e3&displaylang=en

Download details: Windows Server 2003 Resource Kit Tools
http://www.microsoft.com/downloads/...69-57ff-4ae7-96ee-b18c4790cffd&DisplayLang=en
 
Back
Top