Reputation: 38180
I'm trying VS code tasks for the first time, I have created a test.bat
file with
echo hello
and this tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "test",
"type": "shell",
"command": "cmd /c c:\\test\\test.bat"
}
]
}
When running the task, It seems to execute it but why can't I see any output from echo (ie "hello") ?
Upvotes: 2
Views: 2597
Reputation: 12882
Arguments aren't supposed to be posted in command
, so you're task should look like this:
{
"command": "cmd",
"args": ["/c", "c:\\test\\test.bat]
}
However, since Microsoft added auto-detection, the following should work as well:
{
"type": "shell",
"command": ""c:\\test\\test.bat"
}
See the custom task documentation for details.
Upvotes: 3