Visual Studio Code运行指定目录的批处理

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "my task",
            "type": "shell",
            "command": "${workspaceFolder}/abc/mytask.bat",
            "options": {
                "cwd": "${workspaceFolder}/abc/"
            }
        }
    ]
}

这里配置了工作路径cwd,可以确保批处理中使用的路径正确。

猜你喜欢

转载自blog.csdn.net/u013404885/article/details/127012242