Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Trollend |
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)
script_name is the name of a .ps1 script located in res://, and new_image_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!