0.1.1
This commit is contained in:
+23
-8
@@ -1,6 +1,16 @@
|
|||||||
@echo off
|
@echo off
|
||||||
chcp 65001 >nul
|
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
|
where python >nul 2>&1
|
||||||
if %errorlevel% neq 0 (
|
if %errorlevel% neq 0 (
|
||||||
echo 未找到Python解释器,请确保Python已安装并添加到系统PATH
|
echo 未找到Python解释器,请确保Python已安装并添加到系统PATH
|
||||||
@@ -8,12 +18,17 @@ if %errorlevel% neq 0 (
|
|||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
|
|
||||||
REM 执行日志清理脚本
|
REM 设置脚本路径
|
||||||
python "%~dp0clean_logs.py"
|
set SCRIPT_DIR=%~dp0
|
||||||
|
|
||||||
REM 如果执行成功则暂停显示结果
|
REM 执行日志清理
|
||||||
|
echo 正在清理日志文件...
|
||||||
|
"%SCRIPT_DIR%clean_logs.py"
|
||||||
|
|
||||||
|
REM 处理执行结果
|
||||||
if %errorlevel% equ 0 (
|
if %errorlevel% equ 0 (
|
||||||
echo.
|
echo 日志清理完成
|
||||||
echo 日志清理完成!
|
) else (
|
||||||
pause
|
echo 日志清理失败,错误代码:%errorlevel%
|
||||||
)
|
)
|
||||||
|
pause
|
||||||
|
|||||||
Reference in New Issue
Block a user