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

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

Expand Messages
  • Michael Marquart
    May 7, 2003
      If you have a look toward the bottom of the
      FOR /?
      help output you will see all the variables that you can use, similar to
      the %~tX variable that provides the file date/time, and which is the
      variable that is parsed in this batch file.

      A dir /b is used to get the list of filenames to be processed.

      Thanks for the feedback.

      --
      Regards,
      Michael



      On Wed, 07 May 2003 13:36:43 -0500, Jolly Green Giant
      <jollygreengiant@...> wrote:

      >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"
      >>)
      >>)
      >>
    • Show all 12 messages in this topic