Eduardo Perez
Eduardo Perez

Reputation: 573

7-zip command line - Incorrect wildcard type marker

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.

Upvotes: 12

Views: 5444

Answers (1)

Anon Coward
Anon Coward

Reputation: 10825

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

Upvotes: 25

Related Questions