ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Tue Oct 24, 2017 6:03 am

All times are UTC




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Nov 24, 2016 6:46 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6915
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


Top
   
PostPosted: Thu Nov 24, 2016 11:27 pm 

Joined: Thu Nov 24, 2016 9:28 pm
Posts: 2
Thanks for the insight.

When I tried the last script, I get unsatisfactory results sadly.

Image

Each .xwb file that gets applied with unxwb.exe results in a 00000000.wav file, so it would lead to override requests. I tried to apply this batch to see how it goes, and it results in a request for an override to the new "00000000.wav" files, without change in file name (or replicate using the original file name with the new .wav extension).

Code:
for %%G in (*.xwb) do unxwb.exe "%%G"


Top
   
PostPosted: Fri Nov 25, 2016 8:51 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6915
You forgot the && between the md command and unxwb.


Top
   
PostPosted: Fri Nov 25, 2016 9:14 am 

Joined: Thu Nov 24, 2016 9:28 pm
Posts: 2
Ah okay, tried it now and it gave 00000000.wav files in their respective generated folders as needed:

Code:
for %%G in ("*.xwb") do md %%G_output && unxwb.exe -d %%G_output %%G


Now to try and figure how to rename the files inside the folder to match with the folder name...

Thanks aluigi <3!!!

Edit: Got everything done for this rip, working on .pos modifications. This may seem off-topic, but do you know if unxwb will support loop pointer extraction in the future? The ADPCM format seems to play fine (in P4 Ultimax's case, offset 0xA4 ~ 0xA7 = Loop Start... offset 0xA8 ~ 0xAB = Loop Length starting from string "WBND"). I haven't looked at the other format types of .xwb files out there, but I'd guess that it would be different.


Top
   
PostPosted: Fri Nov 25, 2016 3:30 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 6915
No, there will be no support for these loops.
It extracts files from the XWB archives, that's it.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited