Windows批处理文件 - 如何通过循环文件的目录中?

问题描述:

我有这个批次:

for /f %%a IN ('dir /b *.pdf') do call convert.exe %%a

这在获取相同的文件夹CONVERT.EXE每一个PDF文件,多数民众赞成。我希望能够说得清的PDF所在。我有什么改变?

This gets every pdf file thats in the same folder as convert.exe. I want to be able to say where the PDF resides. What do I have to change?

谢谢!

如果目录名能吃苦耐劳codeD,那么这将是

If the directory name can be hardcoded, then it will be

for /f %%a IN ('dir /b /s "Disk:\Your\Directory\Name\*.pdf"') do call convert.exe %%a

请注意,这也将返回磁盘的子目录中的所有.pdf文件:\\您的\\目录\\名称

Note that this will also return all .pdf files in subdirectories of Disk:\Your\Directory\Name.