# Set outputdir in vscode workspace

**URL:** https://forum.robotframework.org/t/set-outputdir-in-vscode-workspace/3536
**Category:** Visual Studio Code(ium)
**Created:** [30 March 2022 13:23 UTC](https://forum.robotframework.org/t/set-outputdir-in-vscode-workspace/3536 "2022-03-30T13:23:12Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Flurin92](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/flurin92/32/1343_2.png) [@Flurin92](https://forum.robotframework.org/u/Flurin92)
#### Post date: [30 March 2022 13:23 UTC](https://forum.robotframework.org/t/set-outputdir-in-vscode-workspace/3536/1 "2022-03-30T13:23:12Z")

</div>

Hi,

I want to specify my Report Directory in Workspace Json (Robot.code-workspace) file like the following:

```
{

    "folders": [

        {

            "path": "test"

        },

        {

            "path": "librenode"

        }

    ],

    "settings": {},

    "launch": {

    "version": "0.2.0",

    "configurations": [

        {

            "type": "robotframework-lsp",

            "name": "Robot Framework: Launch template",

            "request": "launch",

            "cwd": "^\"\\${workspaceFolder}\"",

            "target": "^\"\\${file}\"",

            "terminal": "integrated",

            "env": {},

            "args": ["--outputdir C:/renode/renode_1_12_x/PLT2010V1_V3/test/07_Results"]

            }

        ]

    }

}

```

When I run the Test I get the following error message:

> [ERROR] option --outputdir c:/renode/renode\_1\_12\_x/plt2010v1\_v3/test/07\_results not recognized
> 
> Try --help for usage information.

Can anyone tell what is the reason?

Thank you

---

<div class="post-metadata">

### Author: ![fabioz](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/fabioz/32/983_2.png) [@fabioz](https://forum.robotframework.org/u/fabioz)
#### Post date: [31 March 2022 10:14 UTC](https://forum.robotframework.org/t/set-outputdir-in-vscode-workspace/3536/2 "2022-03-31T10:14:00Z")

</div>

You need to set arguments as a list of arguments, so, the arguments should be something as:

`"args": ["--outputdir", "C:/renode/renode_1_12_x/PLT2010V1_V3/test/07_Results"]`

i.e.: notice that there are 2 strings there instead of one with 2 arguments…

---

<div class="post-metadata">

### Author: ![Flurin92](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/flurin92/32/1343_2.png) [@Flurin92](https://forum.robotframework.org/u/Flurin92)
#### Post date: [31 March 2022 10:53 UTC](https://forum.robotframework.org/t/set-outputdir-in-vscode-workspace/3536/3 "2022-03-31T10:53:04Z")

</div>

Thanks, don’t know why I haven’t tried this… 😅

---

<div class="post-metadata">

### Author: ![msir](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@msir](https://forum.robotframework.org/u/msir)
#### Post date: [22 December 2022 07:56 UTC](https://forum.robotframework.org/t/set-outputdir-in-vscode-workspace/3536/4 "2022-12-22T07:56:25Z")

</div>

When I launch a test from VS Code (/w RF Language Server extension), output files are stored to project root. How do I change the outputdir, didn’t find any setting to control this?

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/robotframework1/original/2X/0/043886d315dd4510d4e14bbb84326a6cdc95a864.png)

---

<div class="post-metadata">

### Author: ![msir](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@msir](https://forum.robotframework.org/u/msir)
#### Post date: [28 December 2022 07:57 UTC](https://forum.robotframework.org/t/set-outputdir-in-vscode-workspace/3536/5 "2022-12-28T07:57:23Z")

</div>

Not that pretty solution, but outputdir can be set by modifying file:

C:\Users\**[user]**\.vscode\extensions\robocorp.robotframework-lsp- **x.x.x** \src\robotframework\_debug\_adapter\run\_robot\_\_main\_\_.py:

=\>

robot\_args = [  
“–listener=robotframework\_debug\_adapter.listeners.DebugListener”,  
“–listener=robotframework\_debug\_adapter.listeners.DebugListenerV2”,  
**“–outputdir=C:/Temp/RobotLogs”,**  
]

---

<div class="post-metadata">

### Author: ![gabe-S](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@gabe-S](https://forum.robotframework.org/u/gabe-S)
#### Post date: [1 October 2024 16:30 UTC](https://forum.robotframework.org/t/set-outputdir-in-vscode-workspace/3536/6 "2024-10-01T16:30:39Z")

</div>

Using the [Robot Framework Language Server extension](https://marketplace.visualstudio.com/items?itemName=robocorp.robotframework-lsp), you can set command line arguments for robot in a vscode launch.json file to change where the report, log, and outputs of your test run live.

In my example below, it’s the `-d` argument, and it redirects the `MyExecutionFolderHere/tests/robot/reports/`.

Note that for some reason, if you put a space between `-d` and your folder path, that space is _included in the folder path_, which is bad. Also, note that the folder path you specify will be [relative to your execution directory](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#output-directory:~:text=The%20path%20set%20with%20this%20option%20is%2C%20again%2C%20relative%20to%20the%20execution%20directory). And for some reason the long version of the argument, `--outputdir` doesn’t seem to work…

(Robot Framework Language Server v1.12.1 prerelease, Python 3.10.12, Robot Framework 7.1, Running on Windows Subsystem for Linux)

```
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "robotframework-lsp",
      
      // This name is required by the robot framework extension for some reason https://github.com/robocorp/robotframework-lsp/issues/1074#issuecomment-2288951860
      "name": "Robot Framework: Launch Template",
      "request": "launch",
      "cwd": "^\"\\${workspaceFolder}\"",
      "target": "^\"\\${file}\"",
      "terminal": "integrated",
      "env": {},
      "args": [
        "-dtests/robot/reports/",
      ]
    }
  ]
}

```
