这里写自定义目录标题
1.创建文件夹和文件
需要准备三个文件,批量新建.bat、nameList.txt、test.docx
@echo off
for /f %%i in (
nameList.txt
) do mkdir %%i && copy test.docx %%i\%%i.docx
:: do mkdir %%i && copy test.docx %%i\%%i.docx && start %%i\%%i.docx
::pause
2.只创建文件
修改下代码
@echo off
for /f %%i in (
nameList.txt
) do copy test.docx %%i.docx
:: do mkdir %%i && copy test.docx %%i\%%i.docx && start %%i\%%i.docx
::pause
练习:批量创建100个文件,要求文件名从1增到100
解决方法: