Error "Could not create child process" when using OS.execute() to run anything

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nimphu

Hello, I am currently using Godot 4 on Windows and sometimes through WSL.

I am trying to build a little game/program that requires data from another executable. The executable prints its output to standard output and I want to grab that output in Godot.

Currently, I am using drag and drop as input to get the path to the file

func _ready(): fit_window_to_screen() menu_button.modulate.a = 0.4 get_viewport().files_dropped.connect(on_files_dropped) func on_files_dropped(files): executable = files[0]

and then trying to use

OS.execute(executable, args, out)

to try and execute my shell script, but I always get Could not create child process: executable, args.

When I try to use .execute() with basic command line arguments (like dir in Windows) it still springs me the same error.

I saw another post about how configuring an external editor can cause issues but I’ve never done anything like that as far as I know. How can I work out what the problem is? I don’t think I have issues when using WSL, but when I launch either the editor preview or the exported executable from WSL, the drag and drop functionality from Windows Explorer doesn’t work.