Windows批处理文件 - 如何通过循环文件的目录中? [英] Windows batch file - how to loop through files in a directory?

查看:87
本文介绍了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.

这篇关于Windows批处理文件 - 如何通过循环文件的目录中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆