' DCU EtherCAT desktop window (pywebview/WebView2). No console, no browser tab. ' Browser-tab launcher: ecat_web.vbs Console-mode debug launcher: ecat_web.bat ' 本文件在 launch\ 下: 先取自身所在目录, 再上一层拿到项目根。 Set sh = CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") here = fso.GetParentFolderName(WScript.ScriptFullName) base = fso.GetParentFolderName(here) sh.CurrentDirectory = base 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 & "\ecat_server.py"" --window", 0, False