0

So I have a shortcut to a personal area network device when I right-click the icon the context menu comes up with an option "connect Using -> access point".

Context menu image
enter image description here

I want to be able to do this operation automatically. I know that a program like AutoHotkey could do this very easily but I will be doing this operation multiple times per minute and if it is possible to do this in a command prompt or using python it would make my life easier

2

1 Answer 1

1

I have found a relatively non invasive method using pywinauto its not ideal for my application but it still works so I thought I would share

from pywinauto import Desktop, Application

Application().start('explorer.exe "path"')

app = Application(backend="uia").connect(path="explorer.exe", title="name1")
app2 = Desktop(backend='win32')                         #for sub actions only

app.folderName.set_focus()
common_files = app.folderName.ItemsView.get_item('fileName')
common_files.right_click_input()
app.ContextMenu.actionName.click_input()
app2.PopupMenu.menu_item('subActionName').click_input() #for sub actions only
app.window(title="name1").close()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.