Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.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
Java 用于自动文件交换的批处理脚本_Java_Xml_Windows_Batch File_Cmd - Fatal编程技术网

Java 用于自动文件交换的批处理脚本

Java 用于自动文件交换的批处理脚本,java,xml,windows,batch-file,cmd,Java,Xml,Windows,Batch File,Cmd,我有一个java工具,可以将xml文件中的值转换为3d模型(使用带有一些纹理的转换矩阵) 要运行它,我使用非常简单的批处理脚本: java.exe -cp path/to/tool.jar;path/to/3dlib.jar;path/to/textures.jar -Dsomejavaoptions -Dappdir=directory tool.some.mainclass file.xml file.bin PAUSE 如果我将此.bat文件放在我的xml文件夹中,它将完成工作+最终在w

我有一个java工具,可以将xml文件中的值转换为3d模型(使用带有一些纹理的转换矩阵)

要运行它,我使用非常简单的批处理脚本:

java.exe -cp path/to/tool.jar;path/to/3dlib.jar;path/to/textures.jar -Dsomejavaoptions -Dappdir=directory tool.some.mainclass file.xml file.bin
PAUSE
如果我将此
.bat
文件放在我的
xml
文件夹中,它将完成工作+最终在windows shell中显示错误(文件不存在、属性错误、缺少内容等)

在.bat fie中手动键入文件名对于大约10个文件来说是很好的,但我有大约10000个文件需要通过这种方式转换。 所有
.xml
文件都位于
xml
文件夹中,文件名的数字范围为1到10000


如何使这个过程更加自动化?我试图用shell中的参数调用file.bat,但我想我需要一些参数和脚本的工作,这些参数和脚本将每隔10000次使用参数执行其他
.bat
文件。

您可以循环目录中的文件

for /r %i in (*) do java.. %i
你也可以使用

您可以使用bash

for f in *.xml; do echo "Processing $f file.."; java.. $f; done
for f in *.xml; do echo "Processing $f file.."; java.. $f; done