0

I have a cmd process running with admin rights. I need to be able to automate some commands. Example echo Testing

MUST connect to existing Admin cmd process. (The cmd must be launched from here Location: C:\windows\system32\ComputerDefaults.exe).

Currently i can connect to a cmd process with normal rights and send code.

from pywinauto import Application


app = Application().connect(process = 16364)
dlg = app.top_window_()
dlg.TypeKeys('hello world')

However i can not connect to my cmd with admin rights. The window flashes but no command is entered.

New to coding :) Any help would be awesome!

Aaron
  • 121
  • 11
  • I have more info here about my problem. https://stackoverflow.com/questions/56606850/python-send-command-to-an-already-running-cmd – Aaron Jun 15 '19 at 05:45
  • Latest pywinauto 0.6.6 should even raise an exception while connecting to admin process. You have to restart your own Python script with admin rights. See how it should look: https://stackoverflow.com/a/42787309/3648361 – Vasily Ryabov Jun 16 '19 at 14:52
  • Anyway you have to disable UAC in Windows settings. Because UAC confirmation window can't be automated by OS design. – Vasily Ryabov Jun 16 '19 at 14:53

0 Answers0