Just a quick tutorial for who wants to run any command-line tool in batch mode on all the files of a folder instead of running it manually for every single file.
So, for example, if you have 1000 fsb or xwb archives and you want to run fsbext and unxwb on them with a single command, that's the trick.
Create a file called file.bat in the target folder containing the following syntax:
Code:
for /r %%G in ("*") do COMMAND %%G
Where COMMAND must be replaced with the full command-line tool and argument you want to run, for example
Code:
for /r %%G in ("*.xwb") do unxwb -l %%G
As you can see I replaced also the * (for ANY file) with *.xwb for running the tool only on the files with XWB extension.
It's even possible to run multiple commands in sequence by appending &&:
Code:
for /r %%G in ("*.xwb") do md %%G_output && unxwb -d %%G_output %%G
You can also use this method from the cmd.exe console, you have only to replace %%G with %G.
Please note that the G in %%G can be anything, so if you prefer %%a you can use it too.
This topic is for anyone who wants to add other methods, tips, suggestions, examples and questions.
It's something that is often asked by users so it's very important to have a topic about it.
P.S.: a good link about this topic
http://ss64.com/nt/for_r.html