QuickBMS "wrong command-line argument"
Page 1 of 1

Author:  jonaskohl [ Mon Aug 13, 2018 6:22 pm ]
Post subject:  QuickBMS "wrong command-line argument"

Hi there!

I use the following batch file to mass extract game files:

@echo off

rem Set directories. Can be changed.
set bfbb_gameroot="<REMOVED FOR FORUM POST>"
set bfbb_export="<REMOVED FOR FORUM POST>"

rem --- Script start ---

rem Prompt user for map directory and map file name
set /p bfbb_mapdir="Enter map directory (e.g. bb):"
set /p bfbb_mapid="Enter map id (e.g. BB01):"

set bfbb_extract="%bfbb_export%\%bfbb_mapdir%"

rem Create output directory
md "%bfbb_extract%"

rem Extract files
quickbms "%cd%\SpongeBobBBBPS2hop.bms" "%bfbb_gameroot%\%bfbb_mapdir%\%bfbb_mapid%.HOP" "%bfbb_extract%"

rem Copy and rename texture files
md "%bfbb_extract%\tex"
copy "%bfbb_extract%\*.RWTX" "%bfbb_extract%\tex\*.txd"

echo Done! Press any key to exit
exit /b

But I get this output from QuickBMS:

QuickBMS generic files extractor and reimporter 0.9.0
by Luigi Auriemma
e-mail: me@aluigi.org
web:    aluigi.org
        (Jun 17 2018 - 11:49:55)

                   quickbms.aluigi.org  Homepage
                            zenhax.com  ZenHAX Forum
                     @zenhax @quickbms  Twitter & Scripts

Error: wrong command-line argument (<REMOVED FOR FORUM POST>\SpongeBobBBBPS2hop.bms)

What am I doing wrong?

Author:  aluigi [ Tue Aug 14, 2018 12:57 pm ]
Post subject:  Re: QuickBMS "wrong command-line argument"

Spaces in the bfbb_* directories that enable the usage of the quote.
Replace quickbms with echo and you will get what I mean, the double quote:
"c:\\SpongeBobBBBPS2hop.bms" ""c:\xxx xxx"\bb\bb01.HOP" """c:\xxx 2"\bb""

This stuff is ever a pain, take a look here:

you can also use the -v option after quickbms for debugging the interpretation of the command-line without echo, long story short it's rare but in some particular occasions there is a difference in how the arguments are handled by C/C++ programs and, for example, .NET. It's not this case but it's just something interesting to know :D

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited