Sascha Posted April 4, 2023 Posted April 4, 2023 I try to open ms edge maximized with a link to a website with this command: ShellExecute("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe","https://www.autoitscript.com/site/autoit/",@ScriptDir,Default,@SW_MAXIMIZE) But if edge was closed before in a none maximized situation it does not start maximized again. I know i can maximize it with the following commands WinWaitActive($title) WinSetState($title,"",@SW_MAXIMIZE) But why does it not start maximized with ShellExecute as expected? Regards Sascha
ioa747 Posted April 4, 2023 Posted April 4, 2023 (edited) ShellExecute("https://www.autoitscript.com/forum/topic/210016-shellexecute-maximized/", "", "", "", @SW_MAXIMIZE) Edit: and if it is not the default browser the edge ShellExecute("C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe", "https://www.autoitscript.com/forum/topic/210016-shellexecute-maximized/", "", "", @SW_MAXIMIZE) Edited April 4, 2023 by ioa747 UpDate I know that I know nothing
Sascha Posted April 4, 2023 Author Posted April 4, 2023 @ioa747 Does not work for me. Edge does not start maximized. I even tried to use @SW_MINIMIZE and the Browser still starts with the size it was closed the last time used it.
SOLVE-SMART Posted April 4, 2023 Posted April 4, 2023 (edited) Hi @Sascha, the suggestion of @ioa747 works fine in my case. Maybe you did (unintended) regedit settings in the past which lead to this behavior? Anyways, you can also add the parameter --start-maximized to your msedge.exe call which should enfore edge to open up maximized. Best regards Sven Edited April 4, 2023 by SOLVE-SMART ==> AutoIt related: 🔗 GitHub, 🔗 Discord Server, 🔗 Cheat Sheet Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon)
Sascha Posted April 4, 2023 Author Posted April 4, 2023 @SOLVE-SMART I have no idea if there are any registry changes because of company policies. But even Win-R with "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --start-maximized does not open edge maximized so this may be. I think i have to live with WinSetState. Thank you both for your help. Regards Sascha
Solution ioa747 Posted April 4, 2023 Solution Posted April 4, 2023 (edited) in edge adress bar paste edge://settings/system and deactivate the Startup boost then try again ShellExecute("https://www.autoitscript.com/forum/topic/210016-shellexecute-maximized/", "", "", "", @SW_MAXIMIZE) Edited April 4, 2023 by ioa747 SOLVE-SMART 1 I know that I know nothing
Sascha Posted April 4, 2023 Author Posted April 4, 2023 Wow. That works. Edge now allways starts up maximized when running from my script and it starts up with the last used size when starting from the icon. Thank you @ioa747 Regards Sascha
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now