' DCU EtherCAT desktop window (pywebview/WebView2). No console, no browser tab. ' Browser-tab launcher: ecat_web.vbs Console-mode debug launcher: ecat_web.bat ' 入口在项目根, 代码在 src\; 工作目录设为 src 以便 py 之间 import 正常解析。 Set sh = CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") base = fso.GetParentFolderName(WScript.ScriptFullName) sh.CurrentDirectory = base & "\src" sh.Environment("PROCESS")("PYTHONUTF8") = "1" ' WebView2: keep GPU rasterization but disable GPU compositing. ' Full hardware acceleration white-screens this window on some GPU drivers; ' --disable-gpu-compositing fixes it while still using the GPU for raster. sh.Environment("PROCESS")("WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS") = "--disable-gpu-compositing" sh.Run """" & base & "\venv\Scripts\pythonw.exe"" """ & base & "\src\ecat_server.py"" --window", 0, False