clipboard/start_clipboard_monitor.bat
2025-07-30 22:11:45 +08:00

35 lines
982 B
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
echo 正在启动剪贴板监控程序...
:: 设置Python路径如果Python已在PATH中可以直接使用python命令
set PYTHON_CMD=python
:: 检查Python是否可用
%PYTHON_CMD% --version >nul 2>&1
if %errorlevel% neq 0 (
echo Python未找到请确保已安装Python 3.11或更高版本
pause
exit /b 1
)
:: 检查必要的库是否已安装
echo 检查必要的库...
%PYTHON_CMD% -c "import pyperclip, pystray, PIL, win32clipboard" >nul 2>&1
if %errorlevel% neq 0 (
echo 正在安装必要的库...
%PYTHON_CMD% -m pip install pyperclip pystray pillow pywin32
if %errorlevel% neq 0 (
echo 安装库失败请手动安装pip install pyperclip pystray pillow pywin32
pause
exit /b 1
)
)
:: 启动剪贴板监控程序
start "剪贴板监控" /B %PYTHON_CMD% "%~dp0clipboard_monitor.py"
echo 剪贴板监控程序已在后台启动
echo 可以在系统托盘中找到程序图标
timeout /t 5
exit