Recently was looking for a simple batch file to archive some of my file with date and time stamp added to it. Compiled a simple script to do the job and it looks like:
d:
Set Source="D:\mySourcePath"
Set Target="D:\myTargetPath"
Set Date=%date:~10,4%%date:~4,2%%date:~7,2%
Set Time=%time:~0,2%%time:~3,2%
REM myFile.log
copy /y %Source%\myFile.log %Target%\myFile_%Date%_%Time%.log
Del /q %Source%\myFile.log
Love coding!
Azure Service Fabric 6.5 Refresh Release
7 years ago
No comments:
Post a Comment