7Zip Command Line script doesn't include all files

I'm trying to create separate zip files for each directory in a given folder, including the 2 files (a .docx file and an .mp4 file) in that directory, but omitting the subfolder "References". It seems to work, but only includes 1 file (the .docx). I can't figure out why it wouldn't include the video as well.

Here is the command:

for /d %%X in (*) do "%ProgramFiles%\7-Zip\7z.exe" a "%%X.zip" "%%X" -xr!References

Any ideas why it would skip this file, but do everything else right?


Main folder -> "1.033 - Operator Control Panel Buttons"

File1 -> "SSM-350 1.033 - Training Plan.docx"

File2 -> "SSM-350 1.033 - Video.mp4"

Subfolder -> "References"


Successfully creates "1.033 - Operator Control Panel Buttons.zip".

Successfully omits "References" folder.

Zip file only contains "SSM-350 1.033 - Training Plan.docx" (missing "SSM-350 1.033 - Video.mp4")

EDIT: I just tried adding another file of a different extension and it included that file (as well as the .docx file), but still omitted the .mp4 file...


Solution 1:

I've found the problem wasn't with my syntax, but from Solidworks PDM. I did not have the latest (or any) version of the file on my computer. Once I got the latest versions, it works just fine