命令提示符复制

时间:2016-01-18 07:53:32

标签: file cmd copy command prompt

我的目录中有文件夹名称,

packages\Example.1.0.0\Example.dll
packages\Example.2.0.0\Example.dll
packages\Example.3.0.0\Example.dll

如何复制文件

copy /Y "C:\Project\Example.dll" 
"C:\Project\packages\Example.???.???.???\Example.dll"

1 个答案:

答案 0 :(得分:0)

cd packages\Example.???.???.???
for %%* in (.) do set _currentfolder=%%~nx*
echo %_currentfolder%
copy /Y "C:\Project\Example.dll" 
"C:\Project\packages\Example.%_currentfolder%\Example.dll"