[<<]Message[>>]    [<<]Author        [<<]Subject        [<<]Thread    

Number : 1125 Date : 2001-12-07 Author : shaynekolata Subject : Re: Move Directory Based On Modified Date Size(KB) : 4
Thank you both for the quick response!!!!!!!!!! Using the routine you have listed below and make the changes to my directory structure here I'm sure xxcopy will still be able to accomplish what I need it to do. Thanks Again, Shayne --- In xxcopy@y..., Kan Yabumoto wrote: > > Thank you Garrydeane: > > You are correct that currently XXCOPY does not do much > with the timestamp value of the directory. But, the reason > for the lack of support in this area is simply a reflection > of XXCOPY's roots. It inherited much of the traits from XCOPY > which came from COPY. In the DOS environment (still today > with Win9x/ME), the directory timestamp cannot be manipulated > as in Win NT/2000/XP. When the directory timestamp cannot > carry much significance, the use is also quite limited. > > Now, we can see the trend that Win9x is phased out and > XP (NT family) becomes the mainstream, XXCOPY will inevitably > evolve towards that direction. That is, before long, we will > probably add more operations based upon the directory timestamp > value. If you hang around the newsgroups for batch files > (alt.msdos.batch and alt.msdos.batch.nt), you will encounter > so many very clever (complicated) batch scripts which carry > out some of the XXCOPY's advanced operations. Of course, > when XXCOPY provides a solution, it is often much shorter > and easier to understand than the batch file technique. > > Here again, the batch technique Garrydeane showed us is > telling us that XXCOPY could do it with more straightforward > switch and therefore we should support such function in the > future. > > Kan > =============================================================== > > At 2001-12-07 00:25, you wrote: > >Xxcopy won't do this as it is file oriented not directory oriented. > >You can do it with a batch file based on a FOR loop and the output > >from a 'dir /o:d /a:d /n' command. You then extract the directory's > >date and do a date comparison with today's date using a batch file > >created by Jerry Schulman called JSIDateM which is available at > >http://www.jsiinc.com/SUBB/tip0700/rh0721.htm > > > >Following is a generic DOS (NT or higher) based 'days old' batch file > >which does the sort of thing you want. This is a bit more complex > >than you might need as it handles various date formats. Obviously, > >once you know how old the directory is, you then carry out a MOVE > >or XXCOPY using the directory name. > > > >@echo off > >:: ---------------------------------------------------------------- -- > >:: Calculate the number of days ago that a directory was created. > >:: Only examines sub-directories of the current directory or sub- > >:: directories of the directory passed as a parameter. > >:: Only uses the file's date (not time) and relies on Jerry Schulman's > >:: JSIDateM routines to calculate the date difference. > >:: ---------------------------------------------------------------- -- > >setlocal > >:: Use date to determine the date format e.g. dd-mm-yy, mm-dd-yy, etc > >for /f "tokens=2 skip=1 delims=()" %%a in ('echo.^|date') do set > >datefmt=%%a > >:: Now get today's date and split it into dd,mm,yyyy based on datefmt > >for /f "tokens=2" %%a in ('date /t') do set today=%%a > >if %datefmt%==dd-mm-yy (set tdd=%today:~0,2%& set tmm=%today:~3,2%& > >set tyy=%today:~6,4%) > >if %datefmt%==mm-dd-yy (set tmm=%today:~0,2%& set tdd=%today:~3,2%& > >set tyy=%today:~6,4%) > >if %datefmt%==yy-mm-dd (set tyy=%today:~0,4%& set tmm=%today:~5,2%& > >set tdd=%today:~8,2%) > >:: Extract the file date & name from the directory listing > >for /f "tokens=1-3,* skip=5" %%a in ('dir %1 /o:d /a:d /n ^| > >find "" ^| find /v "."') do call :check_age %%a "%%d" > >endlocal > >goto :eof > > > >:check_age > >set fdate=%1 > >:: Split the file's date into dd,mm,yy based on datefmt > >if %datefmt%==dd-mm-yy (set fdd=%fdate:~0,2%& set fmm=%fdate:~3,2%& > >set fyy=%fdate:~6,2%) > >if %datefmt%==mm-dd-yy (set fmm=%fdate:~0,2%& set fdd=%fdate:~3,2%& > >set fyy=%fdate:~6,2%) > >if %datefmt%==yy-mm-dd (set fyy=%fdate:~0,2%& set fmm=%fdate:~3,2%& > >set fdd=%fdate:~6,2%) > >:: Add 19 or 20 to get yyyy > >if %fyy% GTR 80 (set fyy=19%fyy%) else (set fyy=20%fyy%) > >:: Call JSIDateM to calculate the date difference. Format is yyyy1 > >mm1 dd1 - yyyy2 mm2 dd2 > >:: JSIDateM sets %ndd% to indicate date difference > >call JSIDateM %tyy% %tmm% %tdd% - %fyy% %fmm% %fdd% > >echo %2 is %ndd% days old > >goto :eof > > > >--- In xxcopy@y..., "shaynekolata" wrote: > > > Can XXCOPY move directories from one drive to another based on the > > > modification or creation date of a directory? > > > > > > > > > > > > > >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.