Start Chrome with a URL with options incognito mode and maximized tab IN BATCH
This command line opens an incognito tab and connects to the URL in environment variable %url%:
start chrome --incognito %url%
This maximizes the tab and connects to the %url%.
start chrome %url% /MAX
But as soon as I try to combine them, like this,
start chrome --incognito %url% /MAX
The /MAX
option does not work.
How can I properly combine their functions?
How can I properly combine their functions?
You may be using /max
in the wrong position. /max
is an option to start
, not chrome
. You also appear to be leaving off the (in most cases) necessary leading set of double-quotes (""
) for start
. So your start
command should look like:
ex. incognito_chrome.bat
set url=plus.net
start "" /max chrome --incognito %url%
Also be aware that if chrome
isn't really chrome.exe
(e.g. it's chrome.bat
), this could be eating your /max
option (in this example, /max
would be used on the command window spawned by chrome.bat
, not Chrome [chrome.exe
] itself). If this is the case, you should use the full path to chrome.exe
rather than just chrome
.
References
- start (ss64 documentation)
The /MAX
is in the wrong position, but it's not strictly necessary because Chrome has a command line option to start maximized.
You can use the command line argument directly:
set url=superuser.com
start chrome --start-maximized --incognito %url%