PDA

View Full Version : Help needed : Batch processing of *.BK2


shazzla
12-04-2019, 04:58
hi !

I have a folder which contents a lot of subfolders ,and those folders have tons of BK2 files.
I need to pack those BK2 files (BPK) one by one ,named as the original ones ,but with .arc extension(in the same subfolder!) ,because some of them cant be processed as BINK.
Selecting/looking for them one by one makes my crazy,time consuming ,etc.
And of course i cant write the code in batch. Im too lame :D

How can i execute this line in batch ?
arc.exe a -i2 -r -mbpk 1.arc 1.bk2
Anyone can help me ?

Simorq
12-04-2019, 14:00
:-ioff --shutdown
SET DIR=J:\Program Files (x86)\Mafia III Deluxe Edition
SET MC=bpk

Arc.exe create -i2 -ds=esn -ep1 -r -ed -s; -w.\Temp -dp"%DIR%" -m%MC% -n"*bk2" "RG-1.Bin"
RD /S /Q TEMP
pause

shazzla
13-04-2019, 00:53
I didnt tried it ,but imho its not good for me.
Real example :

C:\dir1 (126 files)
C:\dir1\dir2 (72 files)
C:\dir1\dir2\dir3 (155 files)

I need to compress each bk2 into separate files(in the same subfolder with .arc extension) ,not in one archive!

I hope you understand. :)

Btw thanks for the help ! :)

Joe Forster/STA
13-04-2019, 02:20
I think you're looking for this:
for /r %%f in (*.bk2) do arc.exe a -i2 -r -mbpk %%~dpnf.arc %%f

The variable called "%f" (if used in a .bat file, "%" must be doubled) is assigned the paths of all files matching "*.bk2" in all subdirectories, in any depth, of the current directory. After each assignment, the command after "do" is executed. The "%~dpnf" syntax splits the path in "%f" into components, keeps the "d"rive, "p"ath and "n"ame components only, and drop the e"x"tension - because you add another extension.

Run "for /?" in the command line for the complete description of the "for" command, including everything I wrote above.

shazzla
13-04-2019, 03:38
Many thanks !
Thats what im looking for ! :)

@Joe Forster/STA : Egyebkent meg hello földi ! :)