帮写一段BAT批处理复制文件的命令?
发布网友
发布时间:2022-04-21 07:14
我来回答
共1个回答
热心网友
时间:2022-06-18 15:48
以下代码复制粘贴到记事本,另存为xx.bat,编码选ANSI
@echo off
rem 将一个指定文件复制到一个指定目录下以当前日期时间命名的文件夹里
set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%@% %z%
for /f "tokens=2 delims==." %%a in ('wmic OS get LocalDateTime /value^|find "="') do set "now=%%a"
set "file=d:\123.mdb"
set "newfolder=z:\%now%"
if not exist "%file%" (echo;"%file%" not found&pause&exit)
if not exist "%newfolder%\" md "%newfolder%\"
copy /y "%file%" "%newfolder%\"
echo;%#% +%$%%$%/%@% %z%
pause
exit