1、生成虚拟环境: virtualenv .env
2、写bat文件:Start.bat @echo off ::设置固定目录路径 set dir=D:\file\python\renewcookie.env\Scripts for /r "%dir%" %%a in (*.exe) do taskkill /f /im "%%~nxa" .env\Scripts\activate&&pythonw.exe renewodpcookie.pyw 3、写vbs文件:后台执行 Set ws = CreateObject("Wscript.Shell") WScript.sleep 5000 ws.run "cmd /c Start.bat",0