I write a batch script:
@echo off
set "zip=C:\Program Files\7-Zip\7z.exe"
for %%f in (%*) do (
if exist "%%~f\" (
"%zip%" a -tzip "%%~f.zip" "%%~f\*" -mx0
) else (
"%zip%" a -tzip "%%~f.zip" %%f -mx0
)
)
When the user selects multiple files/folders and drag them on to the script file, each file/folder dragged is packed into a zip file.
It works fine in most cases. However, if the files being dragged are located in a directory whose filename contains parentheses, such as "myfolder(large)", the script fails out.
Can anyone tell what causes this issue and how to solve it?