Reputation: 195
So, as you may know there are certain apps on Windows that can be installed from the app store, and are classified as Windows Trusted Apps. I am not sure, but I think these do not use the classic .exe format. So I am writing a python script to automate some stuff when I start my pc, and I need to start a certain Windows App, but I don't know how to do this as I don't know what I need to start to do so, and I also do not know where these files are located. Anyone can help?
Upvotes: 2
Views: 19407
Reputation: 1985
Finally, I found a way to run Windows Universal apps which downloaded via Windows Store or preinstalled.
Each Windows 10 Universal app has an AUMID
which stands for 'Application User Model ID'.
PowerShell Command to get all AUMID:
get-StartApps
Output:
PS C:\> get-StartApps Name AppID ---- ----- Skype Microsoft.SkypeApp_kzf8qxf38zg5c!App Snip & Sketch Microsoft.ScreenSketch_8wekyb3d8bbwe!App Mail microsoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.w... Calendar microsoft.windowscommunicationsapps_8wekyb3d8bbwe!microsoft.w... Movies & TV Microsoft.ZuneVideo_8wekyb3d8bbwe!Microsoft.ZuneVideo OneNote for Windows 10 Microsoft.Office.OneNote_8wekyb3d8bbwe!microsoft.onenoteim Photos Microsoft.Windows.Photos_8wekyb3d8bbwe!App Video Editor Microsoft.Windows.Photos_8wekyb3d8bbwe!SecondaryEntry Maps Microsoft.WindowsMaps_8wekyb3d8bbwe!App Alarms & Clock Microsoft.WindowsAlarms_8wekyb3d8bbwe!App Voice Recorder Microsoft.WindowsSoundRecorder_8wekyb3d8bbwe!App Feedback Hub Microsoft.WindowsFeedbackHub_8wekyb3d8bbwe!App Xbox Game Bar Microsoft.XboxGamingOverlay_8wekyb3d8bbwe!App Camera Microsoft.WindowsCamera_8wekyb3d8bbwe!App Microsoft Store Microsoft.WindowsStore_8wekyb3d8bbwe!App Weather Microsoft.BingWeather_8wekyb3d8bbwe!App Cortana Microsoft.549981C3F5F10_8wekyb3d8bbwe!App Instagram Facebook.InstagramBeta_8xx8rvfyw5nnt!Instagram ...
So now, you can start any universal app via its AUMID like this:
explorer shell:appsfolder\[AUMID]
For example, if you want to execute Skype
:
explorer shell:appsfolder\Microsoft.SkypeApp_kzf8qxf38zg5c!App
Now it's the time to back to Python:
>>> import os
>>> os.system('start explorer shell:appsfolder\Microsoft.BingWeather_8wekyb3d8bbwe!App')
The Windows Weather
App will execute.
Happy Coding
Upvotes: 6
Reputation: 171
You can use this new technique, its called winapps its used for searching, modifying, and uninstalling apps. Its download command on cmd windows is pip install winapps
.
Upvotes: 0
Reputation: 21
import os
os.system('start D:\\bharat\\sqldeveloper.exe')
For Windows cmd this [start path/app.exe] will open the app
so just use the full path of the exe of required file (make sure to use \\
in path while writing python script)
Upvotes: 2
Reputation: 670
In case anyone else ever faces the issue:
you can start most windows apps in cmd with the following syntax:
start [program]:
ex:
start Netflix:
Keeping this in mind, to port to pythn simply use the following code:
import os
os.system('start Netflix:')
replace with your program of choice and voila :)
Upvotes: 0