@echo off
echo;
echo --------------------------------------------------前置检查----------------------------------------------------
set dirPath=%CD%
echo 当前目录: %dirPath%
if exist "Service-*.zip" (
echo 服务包存在!
) else (
echo 服务包不存在!
pause
exit 1
)
if exist "server.xml" (
echo 模板文件:server.xml
) else (
echo 模板文件不存在!
pause
exit 1
)
set WinRarPath=%ProgramFiles%\WinRAR\WinRAR.exe
echo WinRarPath = %WinRarPath%
if exist "%WinRarPath%" (
echo Winrar 路径正确!
) else (
echo Winrar 路径不正确!
pause
exit 1
)
@setlocal enabledelayedexpansion
set zipFileName=""
for /f %%a in ('dir /o-d /tc /b Service-*.zip') do (
rem echo 文件完整信息:%%a
set zipFileName=%%~na%%~xa
rem echo zipFileName: !zipFileName!, time: %%~ta
goto end
)
:end
rem @setlocal disableDelayedExpansion
echo %zipFileName% | findstr "Service" && (echo ) || (
echo "未找到服务包!"
【批处理】替换压缩包文件脚本
于 2022-10-16 17:26:50 首次发布