简体   繁体   中英

How to launch Microsoft Store automatically in python or powerShell script?

I want to be able to run the script which will launch App store automatically. I am able to launch Notepad etc. but not Microsoft Store. Thanks in advance for your help.

One option would be to use a library like pyautogui to physically press the windows button and then type "windows store" and press enter. The code would be something like this:

import pyautogui as gui
gui.press("win")
# delay maybe
gui.typewrite("windows store")
gui.press("enter")

This is surprisingly simple to do from PowerShell. This command will do it:

Start-Process ms-windows-store:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM