I found the below batch file and it works fine but I need the code to add the extension to the final zip file. I am sure this is a simple question but I have tried everything.
@echo off
cd /d %~dp0
rem 7z.exe path
set sevenzip=
if "%sevenzip%"=="" if exist "%ProgramFiles(x86)%7-zip7z.exe" set sevenzip=%ProgramFiles(x86)%7-zip7z.exe
if "%sevenzip%"=="" if exist "%ProgramFiles%7-zip7z.exe" set sevenzip=%ProgramFiles%7-zip7z.exe
if "%sevenzip%"=="" echo 7-zip not found&pause&exit
echo %~dp1
echo %~x1
for %%a in (*%extension%) do "%sevenzip%" a "%%~na.zip" "%%a"
pause
برچسب:
نویسنده: استخدام کار