Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

7-zip command line - Incorrect wildcard type marker

Tags:

batch-file

I'm using 7-zip 15.14 64-bit on Windows 10. I have a batch file that compiles a game I'm working on, only problem is I get an error about an "Incorrect wildcard type marker". Here is the line of code taken right from the batch file.

"%ProgramFiles%\7-Zip\7z.exe" a "%expt%\Game_Win.exe" "%expt%\Win\*" -x!*.m4a -sfx -mx9 -y

Note that I do have symbolic links in the directory I'm trying to compress.

like image 447
Eduardo Perez Avatar asked Jul 10 '16 22:07

Eduardo Perez


1 Answers

It sounds like you have enabledelayedexpansion turned on.

With this mode, ! symbols have special meaning, and to make matters more interesting, there are two parse passes on each line, meaning you'll need to double escape them to have the symbol pass through to the target application:

echo "%ProgramFiles%\7-Zip\7z.exe" a "%expt%\Game_Win.exe" "%expt%\Win\*" -x^^!*.m4a -sfx -mx9 -y
like image 149
Anon Coward Avatar answered Sep 18 '22 14:09

Anon Coward