Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows win32,脚本,处理目录中的所有文件_Windows_Command Line_Batch File - Fatal编程技术网

Windows win32,脚本,处理目录中的所有文件

Windows win32,脚本,处理目录中的所有文件,windows,command-line,batch-file,Windows,Command Line,Batch File,我需要使用控制台应用程序处理某个文件夹中的所有txt文件。该命令与此类似: convert input_file.txt -par1 -par2 -par3 如何编写一个批处理程序来处理文件夹中的所有文件,并将文件名作为参数传递给console应用程序?另一个想法,Python解决方案呢?使用for for %f in (*.txt) do @convert "%f" -par1 -par2 -par3 注意,我使用@来抑制for循环每次迭代时命令行的回音。这是可选的 上述语法适合在交互式控

我需要使用控制台应用程序处理某个文件夹中的所有txt文件。该命令与此类似:

convert input_file.txt -par1 -par2 -par3
如何编写一个批处理程序来处理文件夹中的所有文件,并将文件名作为参数传递给console应用程序?另一个想法,Python解决方案呢?

使用
for

for %f in (*.txt) do @convert "%f" -par1 -par2 -par3
注意,我使用
@
来抑制for循环每次迭代时命令行的回音。这是可选的

上述语法适合在交互式控制台上使用。在批处理文件中执行时,必须将
%f
替换为
%f

使用
for

for %f in (*.txt) do @convert "%f" -par1 -par2 -par3
注意,我使用
@
来抑制for循环每次迭代时命令行的回音。这是可选的

上述语法适合在交互式控制台上使用。在批处理文件中执行时,必须将
%f
替换为
%f