是否可以通过外部终端启动bat文件,而不是在vscode终端内启动?
任务示例:
{
"label": "Build",
"type": "shell",
"command": "./build.bat",
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
答案 0 :(得分:2)
tasks.json版本2.0.0编辑:
{
"label": "%name%",
"type": "shell",
"command": "Start-Process -FilePath \"%path to bat%\"",
"presentation": {
"reveal": "never"
},
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
},
对于较旧的tasks.json版本: 因此,虽然vscode在Windows上使用PowerShell作为主要环境,但下一篇文章对我有用:
"command": "Start-Process -FilePath \"path to script\"",
"presentation": {
"reveal": "never"
},