This commit is contained in:
2025-01-15 18:19:09 +08:00
parent a5207952c9
commit 56b8f23880
+22 -7
View File
@@ -1,6 +1,16 @@
@echo off
chcp 65001 >nul
REM 自动查找Python解释器
setlocal
REM 检查管理员权限
net session >nul 2>&1
if %errorlevel% neq 0 (
echo 请以管理员身份运行此脚本
pause
exit /b 1
)
REM 查找Python解释器
where python >nul 2>&1
if %errorlevel% neq 0 (
echo 未找到Python解释器,请确保Python已安装并添加到系统PATH
@@ -8,12 +18,17 @@ if %errorlevel% neq 0 (
exit /b 1
)
REM 执行日志清理脚本
python "%~dp0clean_logs.py"
REM 设置脚本路径
set SCRIPT_DIR=%~dp0
REM 如果执行成功则暂停显示结果
REM 执行日志清理
echo 正在清理日志文件...
"%SCRIPT_DIR%clean_logs.py"
REM 处理执行结果
if %errorlevel% equ 0 (
echo.
echo 日志清理完成!
pause
echo 日志清理完成
) else (
echo 日志清理失败,错误代码:%errorlevel%
)
pause