Opening in a particular Window size
-
Hi, is there something I can add to a command to launch a shorcut, webpage or .exe that gets it to open in a set way, e.g.
- Size: Maximised, Fullscreen, Normal windowed, Minimised or a Window of a specific size?
- At a particular zoom %, etc?
- To click a button within that window?
I've been scratching my head for ages over this, so any help would be much appreciated!
-
@JRSF-Home, I asked ChatGPT about #1 because I remembered it's possible to launch an app minimized or maximized with the start command:
https://chatgpt.com/share/68fcce56-9d20-8004-9046-8a96869e1b9fI suggest looking at AutoHotKey or AutoIT to automate the clicks.
-
@Russ Could you create a shortcut with that parameter and start the program by calling the shortcut?
-
@Xander, I'm finding that only some executables, like notepad.exe support starting them maximized, minimized or normal. If make a shortcut (.lnk file) that targets one of those executables, you can specify it in shortcut settings.

-
@Russ The request for #1 was "launch a shorcut, webpage or .exe" so creating a shortcut this way covers it, no? The shortcut I just created opens a maximized window in Chrome to this page.
My only point being that it might not be necessary to reinvent the wheel. OP would still need to work out the zoom (but remember that browsers remember the zoom level of a given website so that pretty much covers the second step).
-
@Xander, I thought by "shortcut" he was talking about a Windows shortcut like I screenshotted above, not a TRIGGERcmd shortcut. I think he wants to create a TRIGGERcmd command that makes sure the app (maybe Chrome?) launches maximized, starts with a particular zoom % (Chrome can be zoomed).
Assuming it's Chrome, I have my script launch it maximized, then effectively type CTRL 0, then CTRL + once or twice to adjust the zoom.
Here's a list of parameters Chrome takes, but none of them are the zoom level, so you'd have to simulate key presses with nircmd or an AutoIT script or similar.
https://peter.sh/experiments/chromium-command-line-switches/ -
@Russ My screenshot is a .lnk shortcut as well - of Chrome opening with the URL of this discussion in a maximized window.
Zoom level is pretty moot because, unless wants to change a commonly viewed site, pretty much all browsers remember the zoom level of all sites visited. He can go to whateversite.com, set the zoom to 175%, and when the shortcut opens the site, it will be at 175%.
The clicking or scrolling is another, more complicated matter. -
@Xander, got it. Sorry I thought you were suggesting he use Chrome to launch a shortcut. I get your original meaning now.
Just so it's clear to OP, he could put start c:\path\to\shortcut.lnk in the Command field or include it in his script that TRIGGERcmd could run for him. Example:
start C:\Users\russe\Desktop\Claude.lnkThen if he pre-configured the Run field of that .lnk shortcut, he could make it open Maximized.

As for OP's 3rd request - to click a button within that window, I'd ask ChatGPT. Just asked it "how to click a button on a web page with a script." here:
https://chatgpt.com/share/68fe7888-36f8-8004-9c72-e7c6385f927b -
Lots of good stuff in the diologue above, so many thanks for that.
To bring the senario to life, here's a couple of examples of what I'm trying to solve
- Start the morning by opening a Radio player site using Chrome in small window that shows the Channel and 'now playing' info, but leaves the bulk of the screen accessible. Current situtation - I can open the player with TriggerCMD, but then have to go to the PC to manually click on "Play", resize the window and zoom level to get the info to display correctly. As I have to go the PC anyway, this loses any benefit from automation with TriggerCMD!
- Watch some streaming TV whilst prepping lunch. Current situation - a small window opens as was set for Radio, and I have to manually adjust on the PC...
A should add that some services perform best in Chrome, others to Edge or FireFox, and I also play media (Music, DVDs, and Recorded TV from various .exe's, hence the broad question posed.
I have never found that the Maximise setting in Shorcuts works beyond the first click - after that, the last used setting overrides.
It's a bit like shopping trolleys in the supermarket. When you arrive, you want to find them by the entrance ready to wheel straight into the store, not behind a car half way down the lot where the last person left it!
Thanks for the pointers on places to explore. I've found a switch to tag onto the end of a Chrome launch that helps:
--start-maximized
Limitations: Does not work with Win10, Edge, Firefox, .exe'sAlso
--new-window
looks useful for browsers that do not allow apps to be created that open in their own space, e.g. FireFox. (Note this does not directly fix any of the above)I'd like to play a bit more with Keypress Win+Up. How do I tag this onto the end of a TriggerCMD command line? I remember seeing something in one of the tutorials / examples / posts about how to put in multiple actions using a seperator, but have never been able to find it again...