需求概要:将test.spl拷贝15份,并分别重命名为1.spl,2.spl,........15.spl。启动外部转化进程分别将这个15个spl转化为pdf。
1.生成批量拷贝并重名后的新名字文档
REM @echo off
@echo off
set name=FileList.txt
set exc=.spl
for /l %%i in (01,1,15) do (
echo %%i%exc% >>%name%
)
执行后会生成FileList.txt文档,文档为目标命名文件的文件名;如下图:
2.执行拷贝操作将test.spl拷贝15份,目标文件名入上图文件中所示。
REM @echo off
@echo off
set str=test.spl
for /f %%i in (FileList.txt) do (echo F|(xcopy %str% %%i))
执行结果如下:
3.启动外部进程将这15个spl转换为pdf
for /f %%i in (FileList.txt) do (echo F|("外部进程exe路径" "C:\Users\admin\Desktop\splTest\%%i" "C:\Users
\admin\Desktop\splTest\%%i.pdf"))
执行效果如下: