Batch: use multiple files with same extension as a single argument?

windows batch-file textures

72 просмотра

1 ответ

So I'm doing some texture converting, and thought I'd automate some of the process with batch, first half was done easy, now I'm kind of stuck on second half.

The process goes tga > ctex > bch

tga > ctex was easy since you can individually input and convert each file, so I used this batch script;

for %%f in (*.tga) do NW4C_TextureConverter.exe %%f --output=%%~nf.ctex --format=ETC1_A4 --etc_encoding=mediumimproved

However, this won't work from ctex to bch because I need all ctex files found to be used as a single input so that they all combine into a single bch, like so;

NW4C_h3dbincvtr -o=output.bch (ctext file1) (ctex file2) (ctex file3)...

What would be the easiest way to implement the first script so that instead of using each file individually I can append all files to the end of the second command?

Автор: DeathChaos Источник Размещён: 08.11.2019 11:21

Ответы (1)


0 плюса

Thanks for the suggestion, searching for something along those lines helped me find what I needed, for future reference the answer was found here and what I used was; setlocal disableDelayedExpansion set "files=" for /r %%F in (*.ctex) do call set files=%%files%% "%%F" NW4C_h3dbincvtr -o=output.bch %files%

worked perfectly!

Автор: DeathChaos Размещён: 07.09.2016 08:54
Вопросы из категории :
32x32