Extracting mass amount of .bnk files into a folder named as .bnk

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
oux
Posts: 39
Joined: Sun Nov 05, 2017 6:14 am

Extracting mass amount of .bnk files into a folder named as .bnk

Post by oux »

Hello,

I want to extract mas amount of .bnk files with bnkextr.exe, but I wanted all files to be extracted in folder named as *.bnk archive. Could someone help me write a code to do it?
I am using this code to exctract files:

Code: Select all

for %%f in (*.bnk) do bnkextr.exe %%f
pause
ponaromixxx
Posts: 176
Joined: Tue Sep 30, 2014 5:59 pm

Re: Extracting mass amount of .bnk files into a folder named as .bnk

Post by ponaromixxx »

oux wrote:Hello,

I want to extract mas amount of .bnk files with bnkextr.exe, but I wanted all files to be extracted in folder named as *.bnk archive. Could someone help me write a code to do it?
I am using this code to exctract files:

Code: Select all

for %%f in (*.bnk) do bnkextr.exe %%f
pause



Code: Select all

for %%a in (*.bnk) do (
md "%%~na"
bnkextr "%%a"
for %%i in (*.wav) do (
move "%%~ni.wav" "%%~na"
))
pause
oux
Posts: 39
Joined: Sun Nov 05, 2017 6:14 am

Re: Extracting mass amount of .bnk files into a folder named as .bnk

Post by oux »

ponaromixxx wrote:

Code: Select all

for %%a in (*.bnk) do (
md "%%~na"
bnkextr "%%a"
for %%i in (*.wav) do (
move "%%~ni.wav" "%%~na"
))
pause

This code works kind of incorrect: the code creates empty folders with .bnk names, but all .wem files are placed outside of the folders...
oux
Posts: 39
Joined: Sun Nov 05, 2017 6:14 am

Re: Extracting mass amount of .bnk files into a folder named as .bnk

Post by oux »

Ok, I've found a solution!