文件位于此
folderA/aaa.html
folderA/bbb.html
我想将它们复制到folderB
但不同的位置,例如
folderB/aaa/index.html
folderB/bbb/index.html
我试过
for /R "C:\...\folderA\" %%f in (*.html) do copy /y "%%f" "%%~nf/index.html"
无法正常工作,因为我无法放置folderB
请帮忙
答案 0 :(得分:1)
试试这个:
@echo off &setlocal
for %%i in (folderA\*.html) do (
for /f "delims=" %%j in ("%%~dpi.") do (
md "%%~dpjfolderB\%%~ni"
copy "%%~fi" "%%~dpjfolderB\%%~ni\index.html"
)
)