Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch    |    Fun with MS-DOS batch files    |    42,547 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 40,713 of 42,547    |
|    Tim Meddick to All    |
|    Re: Copy option    |
|    04 Aug 13 14:58:14    |
      From: timmeddick@o2.co.uk              You could use Environment Variables to provide unique destination       filenames; such as the current date:              copy filename.ext filename_%DATE%.ext              ...which would result in an example filename, of the copied file;              copy MyNotes.doc MyNotes_04-08-13.doc              ...in a batch file, this might look like the following;               @echo off        echo.        for %%I in (*.*) do call :SUB#1 %%I        goto :EOF               :SUB#1        if EXIST %1 echo "%~n1%~x1" "%~n1_%DATE%%~x1"              ==              Cheers, Tim Meddick, Peckham, London. :-)                             |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca