Move \ Copy Files with Date and timestamps using DOS commands
Posted by Elon B. on September 2, 2012
You can use DOS commands , possibly in a batch file (.bat) if you want, to copy files from one location to another, adding a DATE or TIME stamp to the file name.
Open up a DOS\Command prompt window.
We can see the results of using the ECHO cammand to display the current date and time, as follows.
We can then use this in our Dos COPY command as follows. [ copy *.txt *_%date:/=%_.txt ]
Don’t forget you can use wildcards for the filenames as normal.
Copy with Date and Timestamp [ copy *.txt *_%date:/=%_%TIME::=%.txt /Y ]
Hope you find this useful.
This entry was posted on September 2, 2012 at 2:19 pm and is filed under Microsoft Related, SSIS, Windows 7, Windows Office - General. Tagged: DATE, dos copy command, DOS DATE TIME COPY, TIME, TIMESTAMP. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Please Leave a Reply