How to append date to directory path in xcopy

前端 未结 4 1420
不思量自难忘°
不思量自难忘° 2021-01-14 18:41

I do have a xcopy statement in bat file.. would you please help me to append today\'s date to one of directories in destination xcopy /S /E /I %sourceFolder% \"C:\\Shared\\

4条回答
  •  心在旅途
    2021-01-14 19:16

    Something like this...

    for /f "tokens=2-4 delims=/ " %%A in ('echo.%Date%') do set Dest=C:\Shared\copy-%%A%%B%%C
    xcopy /S /E /I "%sourceFolder%" "%Dest%"
    

提交回复
热议问题