0 votes

The following code executes a Windows powershell command and works fine when launching the program from the editor, but does not work on export:

var array = ["-ExecutionPolicy", "Bypass", "-Command", script_name, "-path", "\'" + new_image_path + "\'"]
var args = PoolStringArray(array)
var _pid = OS.execute("powershell.exe", args, true)

scriptname is the name of a .ps1 script located in res://, and newimage_path is the path to an image on the user's OS that I am attempting to rotate. However, when I export the program and this bit of code is executed, nothing happens. Print statements work fine before and after, but it seems the OS.execute call does nothing. I have ensured that my Windows Powershell is in bypass mode, allowing all scripts to execute from any source.

Any help or advice would be greatly appreciated!

asked May 29 in Engine by Trollend (75 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.