Search code examples
pythonpywinauto

automation using pywinauto to click on start button


I am new to python pywinauto and I want to automate a simple step of clicking on windows start button to open control panel and selecting Administrative tools and finally want to check if the check box is checked or not. I'm stuck in the fist step of how to click on windows start button ?


Solution

  • from pywinauto import Application
    
    Application().start(r'mmc printmanagement.msc') # Warning! it spawns child process
    
    # connect to that child process
    app = Application(backend="uia").connect(path='mmc.exe')
    
    # print main window with the title
    print(app.windows())
    
    app.PrintManagement.dump_tree() # print identifiers for further automation