@echo off :: 判断是否已经以管理员身份运行 net session >nul 2>&1 if %errorLevel% == 0 ( echo 正在以管理员权限运行... ) else ( echo 请求管理员权限... powershell -Command "Start-Process '%~f0' -Verb RunAs" exit /b ) :: 设置窗口标题并运行服务器 title Python HTTP Server on Port 80 echo 启动 Python HTTP 服务器,监听端口 80... python -m http.server 80 pause