Run from vs code

Hi, m kinda new on Godot so here my question I want to run my script from vs code but when I create a JSON file in order to do it. I have an error messahage Like the following:

  • The terminal process failed to launch: Path to shell executable “C:\Godot\Projects Godot<insert-godot-executable-path-here>” does not exist.

But where do I find my godot executable path. THANKS for all who try to help in advance.
(And also if you know a discord about godot in order to help other or to be help i would love to join it) so to conclude ASAP BRO

Execute where command from the terminal. This will show you where the godot executable is located. Copy that path to your vscode project

E.g. where godot

![image|384x500](upload://dSoYkvewqAfCm8l1phPRDMtdMVp
I didn’t get it, how do I know where to write “where” be cause when I do that i just have my current path so it’s not really usefull. In fact I don’t really know if I do that it’ll help me. I just assume that from the Json file where it’s written “insert… here”,so if you have other solution I take it.
(what’s mean “E.G. where godot”)

Sorry at the command line of your Terminal type :

where godot.exe and press Enter.

This will show your path to the executable.

If you want to use VS Code as your editor for Godot, your best bet is to first install the extension godot-tools. This adds syntax highlighting for GDScript and Resources/Scenes, plus, it lets you debug a GDScript as if it was run via the Godot editor. Copy/paste publisher:"Geequlim" godot-tools into the extensions tab and make sure it’s installed and enabled. Then, you can configure your launch options like this:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Run Game", // Name it anything you like
            "type": "godot", // This type is added by the godot-tools extension
            "request": "launch"
        },
    ]
}
1 Like

Hi i didn’t understand well what you said, because for me i already have this lines of code in my json script.


Can you add me on discord in order to talk easily, ofc if you have time to do it :slight_smile: .
My nametag on discord : Hampen94

Oh, I see. You’re using C# within there. On the Godot C# extension’s page, scroll down to the help section on where to put your Godot path. Where it says , you should replace it with the full path name of the actual godot.exe.

Development is a very, very long learning process, and there’s a lot of fundamentals that need to be learned before you can truly grasp everything as a whole.

As a first topic, I suggest looking up how to work with path names in Windows. learning about the commands cd (change directory) and dir (list path names in Windows) would be very helpful.

Thx for your answer, but in fact I know where to find my godot.exe


just here for me I think but when I put the full path (also for me it’s the path of the directory and not the file.

Also in my json file that dosen’t work when i put the path that put some letter in red like it’s an error whereas it’s a str i don’t understand json, file aren’t encode in utf-8 ?
(The image is in the next reply)

can you try putting the extension .exe at the end of the executable? I don’t know if that is required.

I will share my json from 4.2.1

  • launch.json
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Run Godot",
            "type": "coreclr",
            "request": "launch",
            "preLaunchTask": "build",
            "program": "D:/Godot_v4.2.1-stable_mono_win64/Godot_v4.2.1-stable_mono_win64.exe",
            "cwd" : "${workspaceFolder}",
            "console": "internalConsole",
            "stopAtEntry": false,
            "args": ["--path","${workspaceRoot}"]

        }
    ]
}
  • tasks.json
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "type": "dotnet",
            "task": "build",
            "problemMatcher": [
                "$msCompile"
            ],
            "group": "build",
            "label": "build"
        }
    ]
}

So the full path of the folder of my godot exe is : C:\Godot\Godot_v4.2.2-stable_mono_win64\Godot_v4.2.2-stable_mono_win64
(btw the double folder stable…win64 it’s not an error i dont know but when i extract my .zip folder i had this double folder stable…win64)
then i did like you said i add the file with .exe and also change the direction of my slash like in yours json file. (but stil doesn’t work :frowning: )


Also I want to add that I’m not really sure even if it’s the good path that will alow me to run godot from my vs code I just assumed it because I don’t see anything else maybe there is an other way.

Did you have you tried my version? is working.
I have extensions like:

  • .NET Install Tool
  • C# for Visual Studio Code
  • C# Dev Kit for Visual Studio Code
  • IntelliCode for C# Dev KitPreview
    all by Microsoft

do I have to copy whole your json file ( execpt your path ofc) when you say “have you tried my version”.
(yes i have install all these tool already)


(If you have time to explain, it would be easier on discord so I have a notification and we can also call each other if necessary. ,my nametag: hampen94)


is wrong \, replace all \ with /. :wink:

Already did it, look my previous screeshot and it’s still doesn’t work. Did you also pass by this step in order to run godot from your vs code ?

why is not working now you get any error?

That’s the problem, I don’t get an error when I run my json file, nothing happens. That’s what I said, I don’t really know why it doesn’t work, I just assumed that was the problem.


I do Play in Editor like i saw on youtube.

obraz
what is that?

In fact, the first time I runned it, I got this error, then it stopped. Now I don’t get the error, but nothing happens.