PC Review


Reply
Thread Tools Rate Thread

Copy Files dated yesterday

 
 
=?Utf-8?B?R2Fsb3A=?=
Guest
Posts: n/a
 
      8th Apr 2005
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...
 
Reply With Quote
 
 
 
 
Michael Harris \(MVP\)
Guest
Posts: n/a
 
      8th Apr 2005
Galop wrote:
> 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/...6802cc98068a6c




--
Michael Harris
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.



 
Reply With Quote
 
Michael Bednarek
Guest
Posts: n/a
 
      9th Apr 2005
On Fri, 8 Apr 2005 12:59:03 -0700, "Galop"
<(E-Mail Removed)> wrote in
microsoft.public.win2000.cmdprompt.admin:

>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\

--
Michael Bednarek http://mbednarek.com/ "POST NO BILLS"
 
Reply With Quote
 
Michael Harris \(MVP\)
Guest
Posts: n/a
 
      9th Apr 2005
> 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/d...displaylang=en

Download details: Windows Server 2003 Resource Kit Tools
http://www.microsoft.com/downloads/d...DisplayLang=en


--
Michael Harris
Microsoft MVP Scripting
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Please ask follow-up questions via the original newsgroup thread.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy Julian dated folder Shawn Microsoft Access External Data 6 27th Jan 2009 03:47 PM
How can I automatically delete dated slides that become past dated kendik Microsoft Powerpoint 1 21st Sep 2008 12:44 PM
Future dated files Swifty Windows XP Help 0 24th Jan 2008 02:40 PM
macro code to open a file dated yesterday =?Utf-8?B?REI3NA==?= Microsoft Excel Programming 4 9th Sep 2007 03:30 PM
Files being dated 01/01/1601 Andrew Windows XP Help 0 13th Nov 2003 10:45 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:26 AM.