run Microsoft apps from the Microsoft store Topic is solved
Re: run Microsoft apps from the Microsoft store
Then it seems to be what you proposed is the problem. You might try running the script as administrator, or use one of the other methods mentioned in the FAQ answer regarding UAC.
Re: run Microsoft apps from the Microsoft store
Thanks for advice and support. I take a look at FAQ you linked and let know.
Re: run Microsoft apps from the Microsoft store
I read the linked FAQ (by my non-codie eyes and mind) and if I understood it well, the possible solution is to set the AHK Launcher to „Run all scripts with a specific interpreter" which i set to be "C:\Program Files\AutoHotkey\v2\AutoHotkey64_UIA.exe". I did that but it did not help.
Following code for launching WhatsApp which is installed from Microsoft Store does nothing:
P.S:: My .ahk script is in Startup directory so it is launched automatically when Windows 11 start. I do not know if this fact has some impact on the way the script is launched or not.
Any advice, how to make it work?
Following code for launching WhatsApp which is installed from Microsoft Store does nothing:
Code: Select all
#w:: {
loop Files, A_ProgramFiles "\WindowsApps\WhatsApp.exe", "R" {
MsgBox '"' A_LoopFileFullPath '"'
break
}
}
Any advice, how to make it work?
Re: run Microsoft apps from the Microsoft store
I would first try right-clicking on your script file in File Explorer and select "Run as administrator" and see if that works, even if that's not necessarily your long-term solution given the cautions in the FAQ regarding running a script as administrator.
Re: run Microsoft apps from the Microsoft store
It works! If I rightclick the script and select Run as Administrator“, following code launches WhatsApp:
So how to make it work automatically?
Code: Select all
#w:: {
loop Files, A_ProgramFiles "\WindowsApps\WhatsApp.exe", "R" {
Run '"' A_LoopFileFullPath '"' ; best to surround it in quotes in case there are spaces in the path
break
}
}
Re: run Microsoft apps from the Microsoft store
You can have your script automatically run itself as administrator by adding the code to the top of your script that is shown here. But remember as the FAQ points out:
Note that this also causes any programs launched by the script to run as administrator, and may require the user to accept an approval prompt when launching the script.
Re: run Microsoft apps from the Microsoft store
Thank you all a lot! It finally works and I was also able to transform all my AHK shortcuts from v1 to v2.