0
@ECHO OFF
SET /P parent_folder=Please specify parent directory: 
SET /P destination_folder=Please specify destination: 
set NOW=%date:~10,4%-%date:~4,2%-%date:~7,2%--%time:~0,2%.%time:~3,2%
FOR %%n in (%parent_folder%*.*) DO (
  copy "%%n" "%destination_folder%" 
  set /A count+=1
)

到目前为止它还没有工作。如果有人让它工作,我可以将日期附加到%destination_folder%我的结果中。

4

1 回答 1

0

您可以将时间戳附加到目标文件名,如下所示:

for %%n in ("%parent_folder%\*.*") do (
  copy "%%~n" "%destination_folder%\%%~nn_%NOW%%%~xn"
  set /a count+=1
)
于 2013-04-02T18:20:27.357 回答