I'm developing an image for Windows 10 to deploy, and one of the requirements is that when Edge is started for the first time it should be maximized (not fullscreen, but maximized – the same result as clicking the maximize button in the title bar).
I've tried using the powershell start-process
commandlet with the -WindowStyle Maximized
argument, but this is not honoured, e.g.:
start -windowstyle Maximized microsoft-edge:http://www.example.com
I've tried various powershell solutions which resize other program windows (with the idea of spawning Edge then resizing it), but they don't seem to have any effect on Edge, e.g.:
- https://gallery.technet.microsoft.com/scriptcenter/Set-the-position-and-size-54853527
- https://gist.github.com/jakeballard/11240204
I've used Process Monitor to record what's happening when I maximize then shutdown Edge, and I can see it sets the registry keys:
HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Main\LastClosedWidth
HKCU\SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge\Main\LastClosedHeight
with the horizontal and vertical size of the desktop, but manually changing these with regedit
doesn't change the size of Edge when I start it again.
If Edge is made fullscreen then exited, it starts fullscreen in the future – is there a way to start Edge maximized without this manual intervention?
Best Answer
Just sending the keystrokes for alt+space, then X maximizes window. See below powershell script. Save as a .ps1.