MoPaQ is probably the first MPQ tool that existed:
The premiere MPQ editing program
files.campaigncreations.org
The definitive, all in one guide to the MPQ file format
sfsrealm.hopto.org
It was popular, so Ladik's MPQ Editor supports its syntax (I hope so, while writing this). It was possible to write MoPaQ2000 scripts.
How to access its help / interactive menu?
MPQEditor.exe /console
then type "help"
Available commands
Code:
new (n)
open (o)
openpatch (op)
add (a)
extract (e)
rename (r)
move (m)
delete (d)
flush (f)
compact
htsize (t)
list (l)
mksvf
close (c)
script (s)
chdir (cd)
exit (x)
quit (q)
help (h)
ver (v)
version
console
MoPaQ script interpreter also supports Windows command line.
For example, type "md /?" for help on the Windows "md" command.
help
help [command]
Shows basic help about a command.
new
n[ew] MpqFile [MaxFileCount]
Creates a new MPQ. If the file already exists, it will be converted to MPQ.
MpqFile Name of the MPQ to be used for this operation.
MaxFileCount File limit. Can be a dec or hex number. Default is 0x1000.
open
o[pen] MpqFile [ListFile]
Opens an existing MPQ. If the file doesn't exist, the function fails.
MpqFile Name of the MPQ to be used for this operation.
ListFile Name of the listfile to be used on open operation
openpatch
op[enpatch] BaseMpq PatchName1 PatchName2 ... PatchNameN [/listfile|/lf ListFile1 ... ListFileN]
Opens multiple MPQs in patch mode. If any of the MPQs doesn't exist,
the function fails.
BaseMpq Name of the base MPQ.
PatchNameX Name of patch MPQ. Older patch MPQs must come first.
ListFile Name(s) of external listfile(s) to be additionally used.
add
a[dd] MpqFile [SourceFile] [TargetName] [/wav] [/c] [/auto] [/r]
Adds one or more files into the MPQ. Replaces existing files.
MpqFile Name of the MPQ to be used for this operation.
SourceFile Name of source file. Can contain wildcards.
TargetName Target file name (or directory name) in MPQ.
/wave Add the file as WAVE file
/c Use data file compression
/auto Choose compression by file type
/r Recurse subdirectories
extract
e[xtract] MpqFile FileName [TargetDir] [/fp]
Extracts one or more files from MPQ Archive.
MpqFile Name of the MPQ to be used for this operation.
FileName Full of file in MPQ.
TargetDir Target dir. If not entered, the current dir will be used.
/fp Forces extraction with the path stored in MPQ file
/lower Creates lowercase path
Currently only supports literal filenames, i.e. "File00000510.xxx" in an obfuscated map, even if it's actually "war3map.j" in MPQ root.
Filename = * (asterisk) will extract all files.
rename
r[ename] MpqFile OldFileName NewFileName
Renames a file within MPQ.
MpqFile Name of the MPQ to be used for this operation.
OldFileName Name of file to be renamed.
NewFileName New name of the file
move
m[ove] MpqFile FileName NewDirectory
Moves a file within MPQ into another dir.
MpqFile Name of the MPQ to be used for this operation.
FileName Name of file to be moved.
NewDirectory Target directory within MPQ to move the file to
delete
d[elete] MpqFile FileName
Deletes a file within MPQ.
MpqFile Name of the MPQ to be used for this operation.
FileName Name of file to be deleted
flush
f[lush] MpqFile [ListFile]
Compacts the MPQ, removing all empty space.
MpqFile Name of the MPQ to be used for this operation.
ListFile Listfile name. If none, the internal listfile is used.
compact
compact MpqFile [ListFile]
Compacts the MPQ, removing all empty space.
MpqFile Name of the MPQ to be used for this operation.
ListFile Listfile name. If none, the internal listfile is used.
h[t]size MpqFile HashTableSize
Changes hash table size of the archive.
MpqFile Name of the MPQ to be used for this operation.
HashTableSize File limit. Can be a dec or hex number. Default is 0x1000.
list
l[ist] MpqFile [FileMask] [OutFile]
Lists files in MPQ.
Can list them to the screen or to a file.
MpqFile Name of the MPQ to be used for this operation.
FileMask File mask to be listed
OutFile Name of text file that contain the file list.
mksv
mksv
Creates a file that contains MD5 values of each file in the MPQ.
close
c[lose]
Closes currently open MPQ.
Automatically done at the end of script processing or after "exit" command.
script
script ScriptFile
Processes a MoPaQ 2000 script.
chdir
chdir NewDirector
Changes the current directory.
exit | qui
exit | qui
Closes the script console.
Also closes opened MPQ.
v[er] | versio
v[er] | versio
Shows version of MPQ Editor.