Search code examples
pythonpython-3.xaccess-deniedpywinautopyautogui

app.start() returns can't create process access is denied error


I'm working on gui-automation using pyautogui and pywinauto(Python). I tried starting a .exe file via a remote desktop connection (windows server 2008) but app.start returns "Can't create process, access is denied" error. I tried granting full control access too, but that doesn't help.Is there any solution for this?

I pass my user credentials while connecting, and the connection gets established too.

Thanks in advance!!


Solution

  • RDP connection doesn't pass any GUI text information. You have to run the automation script on the remote machine (script should be stored on the same remote machine also). It's also possible to use PsExec or Ansible from local machine to run the automation remotely. See details here (second rated answer):

    https://serverfault.com/questions/690852/use-powershell-to-start-a-gui-program-on-a-remote-machine