How the OS.execute function works

Godot Version

Godot 3.5.3


I want to return at least something to Godot from the console, but the array is empty

var arr = []
	var res = OS.execute("cmd.exe",["/c","echo","hello"],false,arr,false,false)
	print (arr)

and the second question, if I need to run another application other than cmd.exe, do I need to write its full path?

your code is almost equivalent to my code, but nothing works for me :frowning:

By changing the third argument to true, everything worked! :upside_down_face:

var arr = []
var res = OS.execute("cmd.exe",["/c","echo","123"],true,arr,false,true)
print (arr)
1 Like

It’s strange why it doesn’t work like this:

var res = OS.execute("python.exe",["print(1)"],true,arr,false,true)