終於有人來討論了,先丟一個修正版本,可使用 Unicode 檔名/目錄。(其實還不盡完善,但在此主題中夠用了!)
看不懂再來討論。
@echo off
set Z7_Path=c:\program files\7-zip\7z.exe
for %%a in (%*) do (
if not exist "%%~a" goto ERROR1
if exist "%%~a\" (
"%Z7_Path%" a -tzip "..\%%~na.zip" "%%~a\*"
) ELSE (
"%Z7_Path%" a -tzip "..\%%~na.zip" "%%a"
)
)
goto END
:ERROR1
echo Not exist PathName "%1" !
goto END
:END