I found a new way, from electron doc, there is a variable ELECTRON_NO_ATTACH_CONSOLE
you can add set ELECTRON_NO_ATTACH_CONSOLE=1 before start code.exe
https://www.electronjs.org/docs/latest/api/environment-variables#electron_no_attach_console-windows