在windows下利用copy命令复制文件
完整demo如下
echo chcp 936
set h=%TIME:~0,2%
if %TIME:~0,2% leq 9 (set h=0%TIME:~1,1%)else set h=%TIME:~0,2%
set current_date=%date:~0,4%%date:~5,2%%date:~8,2%%h%%time:~3,2%%time:~6,2%
echo "current date is %current_date%"
set source="D:\target\service-3.1.3.jar"
set destination="service-3.1.3-%current_date%.jar"
copy /y %source% %destination%
网友评论