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!

in Engine by (86 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 Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.