Visual Studio Code starting from command line batc

2019-07-04 16:27发布

my Batch looks like this

@Start "VisualStudioCode" "C:\Program Files\Microsoft VS Code\Code.exe" %*

in the command windows i got every hour a message:

[main 12:14:41] update#setState idle
[main 13:14:39] update#setState checking for updates
[main 13:14:40] update#setState idle
[main 14:14:39] update#setState checking for updates
[main 14:14:43] update#setState idle
[main 15:14:39] update#setState checking for updates
[main 15:14:41] update#setState idle
[main 16:14:39] update#setState checking for updates
[main 16:14:40] update#setState idle
[main 17:14:39] update#setState checking for updates
[main 17:14:41] update#setState idle

how can i supress these messages?

3条回答
乱世女痞
2楼-- · 2019-07-04 17:14

Try running "C:\Program Files\Microsoft VS Code\bin\Code.cmd" instead, as this is the CLI version. Code.exe is the electron app that should not be in the path.

查看更多
3楼-- · 2019-07-04 17:23

i ended here:

@echo off
setlocal
set VSCODE_DEV=
set ELECTRON_RUN_AS_NODE=1
call "C:\Program Files\Microsoft VS Code\Code.exe" "C:\Program Files\Microsoft VS Code\resources\app\out\cli.js" -n
ping 127.0.0.1 -n 2 > nul
call "C:\Program Files\Microsoft VS Code\Code.exe" "C:\Program Files\Microsoft VS Code\resources\app\out\cli.js" %*
endlocal
查看更多
爷、活的狠高调
4楼-- · 2019-07-04 17:27

The solution for me was to remove:

D:\Users\<me>\AppData\Local\Programs\Microsoft VS Code\

from my path and add:

D:\Users\<me>\AppData\Local\Programs\Microsoft VS Code\bin

Now when I type'code' it launches code.cmd, not code.exe. (My paths are for the per-user version. Adjust for system-wide version as necessary)

查看更多
登录 后发表回答