3045Re: [BATCH WORLD] Append File Name w/ Date
- May 7, 2003Works great!!! Thanks!
So, for my own education, what I'm seeing is that we are not able to get
into any file attributes that are not displayable on the screen, eh? We
basically read in a directory listing, and then parse that, right?
__________/ Michael Marquart \__________
>I did note one error - the terms in the target portion of the rename
>command should be correct now.
>:: Renames all files in the current folder to filename-yymmdd.ext
>:: when DIR date format is in mmddyy
>for /f "delims=" %%a in ('dir *.* /b') do (
>for /f "tokens=1-3 delims=/- " %%b in ("%%~ta") do (
>echo ren "%%a" "%%~na-%%d%%b%%c%%~xa"
>On Thu, 08 May 2003 02:22:46 +1000, Michael Marquart
> >Try this on some files in a test folder. I don't have a W2K box handy
> >test it on. ATM it doesn't perform the rename, it just prints the
> >on the screen. Remove the "echo " if it seems to be doing as it should.
> >I'd appreciate some feedback on this, if it works or not. Thanks.
> >@echo off
> >:: Renames all files in the current folder to filename-yymmdd.ext
> >:: when DIR date format is in mmddyy
> >:: Untested
> >for /f "delims=" %%a in ('dir *.* /b') do (
> >for /f "tokens=1-3 delims=/- " %%b in ("%%~ta") do (
> >echo ren "%%a" "%%~na-%%c%%a%%b%%~xa"
>Yahoo! Groups Sponsor
>To Post a message, send it to: batchworld@...
>To Unsubscribe, send a blank message to:
>Your use of Yahoo! Groups is subject to the
><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
- << Previous post in topic Next post in topic >>