简体   繁体   English

Windows批处理文件重命名以进行批处理渲染

[英]Windows batch file renaming for batch rendering

I have a number of files inside a folder that I am trying to run through a batch render command for command line rendering. 我试图通过批处理渲染命令运行命令行渲染时,文件夹中有许多文件。 The batch works, but I want to access the name of each file and set it as output name for the generated png file. 该批处理有效,但我想访问每个文件的名称并将其设置为生成的png文件的输出名称。 Here is my batch command: 这是我的批处理命令:

set process_dir=%CD%
C:
cd C:\solidangle\mtoadeploy\2016\bin
for /r %process_dir% %%f in (*.*) do kick -set defaultArnoldDriver@driver_png.RGBA.filename "C:\Arnold\batch\file_name.png" -l ../shaders -dw -v 4 -t 6 %%f

so for example in the path "C:\\Arnold\\batch\\file_name.png" I want to replace the 'file_name' with the name of the file that is executed in order to produce that png file. 因此,例如,在路径“ C:\\ Arnold \\ batch \\ file_name.png”中,我想将“ file_name”替换为要生成该png文件而执行的文件名。 Any help would be much appreciated! 任何帮助将非常感激!

I am not familiar with the render application you are using but I can suggest you the following way. 我不熟悉您使用的渲染应用程序,但可以通过以下方式建议您。 Replace file_name with %%~nf in your example. 在您的示例中,将file_name替换为%%~nf

To learn more about this feature and other read help with 要了解有关此功能的更多信息以及有关

FOR /?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM