Computing.Net > Forums > Disk Operating System > How to copy files of certain date

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.

How to copy files of certain date

Reply to Message Icon

Name: Margot
Date: April 26, 2004 at 07:36:00 Pacific
OS: DOS
CPU/Ram: Pentium 4 248MB
Comment:

Hi

Can anyone tell me how to search a drive for files and folders created or modified before a certain date and then to copy these to a new folder?

Thanks in advance
MM



Sponsored Link
Ads by Google

Response Number 1
Name: DAVEINCAPS
Date: April 29, 2004 at 23:37:56 Pacific
Reply:

Xcopy has a /d switch that allows you to copy files dated after a certain date.

Xxcopy is freeware that's similar to xcopy but has more command switches. It has a /db switch that copies files dated before a particular date. I'm not all that familiar with it, having only used it once or twice to clone a drive. You can get more info and download it at www.xxcopy.com.


0

Response Number 2
Name: martymac
Date: May 9, 2004 at 18:44:56 Pacific
Reply:

I have been reading this forum to find answers for my script issue:how to ftp a filename that has a date 2 days ago(ie today May 9 I get a file filename050704.txt. I ran into issues at the first, second,8th and 9th of the month. My solution may help you:
*******************************************
rem windows 2000 script to search for file 2 days old then ftp mget
set dd=%date%

set year=%dd:~12,2%
set day=%dd:~7,2%
set month=%dd:~4,2%

rem check for day = 1,2,8,9

if not %day%==01 goto one
if %month%==01 set month=12
if %month%==02 set month=01
if %month%==03 set month=02
if %month%==04 set month=03
if %month%==05 set month=04
if %month%==06 set month=05
if %month%==07 set month=06
if %month%==08 set month=07
if %month%==09 set month=08
if %month%==10 set month=09
if %month%==11 set month=10
if %month%==12 set month=11
if %month%==01 set month=12
if %month%==02 goto :day2
if %month%==03 goto :day4
if %month%==04 goto :day3
if %month%==05 goto :day4
if %month%==06 goto :day3
if %month%==07 goto :day4
if %month%==08 goto :day3
if %month%==09 goto :day4
if %month%==10 goto :day3
if %month%==11 goto :day4
if %month%==12 goto :day3

:one
if not %day%==02 goto :two
if %month%==01 set month=12
if %month%==02 set month=01
if %month%==03 set month=02
if %month%==04 set month=03
if %month%==05 set month=04
if %month%==06 set month=05
if %month%==07 set month=06
if %month%==08 set month=07
if %month%==09 set month=08
if %month%==10 set month=09
if %month%==11 set month=10
if %month%==12 set month=11
if %month%==01 set month=12
if %month%==02 goto :day3
if %month%==03 goto :day5
if %month%==04 goto :day4
if %month%==05 goto :day5
if %month%==06 goto :day4
if %month%==07 goto :day5
if %month%==08 goto :day4
if %month%==09 goto :day5
if %month%==10 goto :day4
if %month%==11 goto :day5
if %month%==12 goto :day4
:two
if not %day%==08 goto three
set yesterday=1006
goto start2
:three
if not %day%==09 goto start1
set yesterday=1007
goto start2
:day1
set yesterday=1027
goto month
:day2
set yesterday=1028
goto month
:day3
set yesterday=1029
goto month
:day4
set yesterday=1030
goto month

:day5
set yesterday=31 goto start2
:month
set /A month=%month%+1000
set month=%month:~2,2%
goto start2
:start1
set yesterday=%day%
set /A yesterday=%yesterday%-2
set /A yesterday=%yesterday%+1000
:start2
set yesterday=%yesterday:~2,2%
:start3
set filename=asossr.%month%%yesterday%%year%*
echo open example.com > c:\ftp_outputs\ftp_example.txt
echo lcd c:\ftp_outputs >> c:\ftp_outputs\ftp_example.txt
echo cd /public_files/examples >> c:\ftp_outputs\ftp_example.txt
echo ascii >> c:\ftp_outputs\ftp_example.txt
echo prompt n >> c:\ftp_outputs\ftp_example.txt
echo ls %filename%
echo mget %filename% >> c:\ftp_outputs\ftp_example.txt
echo bye >> cc:\ftp_outputs\ftp_example.txt

ftp -A -s:c:\ftp_outputs\ftp_example.txt
cd c:\ftp_outputs
copy *.brid d:\accert\accert.dat
del *.brid


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: How to copy files of certain date

how to copy files using date www.computing.net/answers/dos/how-to-copy-files-using-date/12582.html

Copy file without changing Date? www.computing.net/answers/dos/copy-file-without-changing-date/12225.html

how to copy disk to hard drive dos www.computing.net/answers/dos/how-to-copy-disk-to-hard-drive-dos/14350.html