Loading ...
Sorry, an error occurred while loading the content.

3045Re: [BATCH WORLD] Append File Name w/ Date

Expand Messages
  • Jolly Green Giant
    May 7, 2003
    • 0 Attachment
      Works 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.
      >
      >@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-%%d%%b%%c%%~xa"
      >)
      >)
      >
      >On Thu, 08 May 2003 02:22:46 +1000, Michael Marquart
      ><micm@...> wrote:
      >
      > >
      > >Try this on some files in a test folder. I don't have a W2K box handy
      > to
      > >test it on. ATM it doesn't perform the rename, it just prints the
      > command
      > >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:
      >batchworld-unsubscribe@...
      >
      >Your use of Yahoo! Groups is subject to the
      ><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
    • Show all 12 messages in this topic