一个文件夹中的所有文件执行命令 [英] Execute a command for all files in a folder
本文介绍了一个文件夹中的所有文件执行命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在目录中的所有文件运行命令。
对于%% 1(C \\转换* .ajt)做的 convert命令的%% 1 %% 2
不过,我需要有一个输出文件名相同,输入但使用不同的文件扩展名。
I want to run a command on all files in a directory. For %%1 in (c\conversion*.ajt) do convert command %%1 %%2 However I need to have an output filename the same as the input but with a different file extension.
asciitojt.exe filename1.ajt filename1.jt
asciitojt.exe filename2.ajt filename2.jt
asciitojt.exe filename3.ajt filename3.jt
是我想离开该系统。结果
我如何取代最后3个字符?
这是在一个批处理文件运行。
is what I want to get out of the system.
How do I replace the last 3 characters?
This is to run in a batch file.
推荐答案
试试这个:
for %%i in (*.ajt) do "asciitojt.exe" "%%~i" "%%~ni.jt"
开始与* .ajt文件的文件夹中。
Start in the folder with the *.ajt files.
这篇关于一个文件夹中的所有文件执行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文