How to use Chrome command line switches in Windows

Control Chrome with command line flags

Windows PC laptop computer and coffee

If you use Chrome browser on a Windows PC, customize the browser’s startup using little known command line flags or switches that enable or disable features, or access certain features.

Chrome can simply be started by clicking the icon in the taskbar, on the desktop, or in an Explorer window. It can also be started from the Start menu. However, all these different ways of starting it result in the same action and the default Chrome application window appears.

There are other ways of starting Chrome and you might want to start with an incognito window for example. Normally, you would have to start Chrome, open the menu, then select New incognito window. However, starting up with an incognito window by default saves time and effort.

This is possible using a command line switch or flag. One way to use command line switches is to open a command prompt window and changed to the folder on the disk containing Chrome. It could then be started by entering:

chrome.exe

If you wanted to start Chrome in incognito mode, you would enter:

chrome.exe –incognito

That –incognito (space and then two dashes incognito) is the command line switch and it tells Chrome how to start. There are dozens of command line switches for Chrome, but many are not useful, at least to the average Chrome user just wanting to browse the web. A lot of command line switches are useful only to programmers and developers.

Here, I just want to focus on the handful of most useful command line switches, ones you might actually want to use. However, before looking at them, let’s see a worked example of how to use one. Not from the command prompt, but from a custom desktop icon that can be used to start Chrome browser.

1 View app command lines

Task Manager processes tab columns in Windows

We need to know where Chrome is located on the disk drive and we could search for it in Explorer, but there is a simple method. Right click an empty part of the taskbar and select Task Manager on the menu that is displayed.

Select the Processes tab and if you do not see a Command line column, right click any column header and select it from the list.

2 View Chrome command line

Task Manager in Windows showing app command lines

Start Chrome and it appears on the Processes tab in Task Manager. Click the little arrow next to Chrome to expand all the entries and you can then see the command line or location of the chrome.exe file.

3 Create a desktop shortcut

Create a desktop shortcut to Chrome browser in Windows

Now that we know Chrome’s location, right click the desktop and select New, Shortcut. In the window that appears, click the Browse button and then find and select chrome.exe. You know where it is from Task Manager.

4 Add a Chrome command line switch

Chrome shortcut command line switch

Click in the box, type a space and then the switch you want to use with this shortcut. For example, you could add –incognito to start the browser in incognito mode (space dash dash incognito).

5 Name it, save it

Create a desktop shortcut to run Chrome in Windows

All that remains is to click the Next button and give the desktop shortcut a descriptive name. In this case, Chrome Incognito will do.

We now have a desktop icon that starts Chrome with a command line switch.

More Chrome command line switches

Create more desktop shortcuts and add the following command line switches in the same way. Save each one with a descriptive name. You could have half a dozen desktop icons to start Chrome in different ways.

Set Chrome’s start size and position

If you want to start Chrome full screen regardless of what size and position it previously had, use the following command line switch:

–start-maximized

Chrome remembers the size and position of its window and the next time the browser is started, it openes in the same position and at the same window size. This is often useful, but not always and sometimes you might want to start Chrome with a certain size and place on the screen. Create a shortcut and add this command line switch:

–window-position=500,100 –window-size=800,600

The first part, –window-position, sets the position of the top left corner of the browser window and the second part, –window-size, determines the size of the window. Just remember that 0,0 is the top left corner of the screen, so 500,100 is 500 pixels across and 100 pixels down.

Turn websites into apps

A web browser has an address box with the website or page URL, toolbar buttons, scrollbars and other items. All this interface clutter can be removed and websites can be used in a cleaner and simpler window.

It makes websites look and work like apps. It does not suit all websites, so you will not want to use this all the time, but for a few, it is very useful. Create shortcuts with the following command line switches. There are more sites and these are just a few examples:

–app=”https://mail.google.com”
–app=”https://keep.google.com”
–app=”https://onedrive.live.com/”
–app=”https://outlook.live.com/”

Some command line switches can be combined, so we could add the position and size switches to these commands. For example, here is how to start Google Keep in a window like an app:

–app=”https://keep.google.com” –window-size=800,600

No address box, no scrollbars, no toolbar, no menus, just Keep. Add this to the end of the command to start Chrome in the shortcut box.

Browse in silence

One of the most annoying things on the web is audio that plays automatically when a page loads. Often this is because of a video and often because it is an advert. If you really don’t like audio on the web, it can be disabled.

Right click a tab and there is a Mute Site menu option that blocks the site, but the next site you go to might have auto-playing audio or video. It would be a pain to have to mute every site individually, so there is a global mute command line switch:

–mute-audio

No sound will be heard from Chrome. This stops not only irritating sound in auto-playing ads, but also YouTube and other sites that have audio. If you want to listen to music or video, start Chrome in the normal way.

Continue browsing

Open Chrome’s menu and select Settings. In the On startup section is an option to start Chrome exactly where you left off last time. So if you had five tabs open with different websites and web pages last time you closed Chrome, it will reopen them when Chrome is next started.

This feature is useful when you want to continue browsing all the sites you had open last time, but it is an irritation when you don’t and lots of tabs open. It slows down startup and you then have to close them all before going to the website you really want.

Create a desktop shortcut with the following command line switch:

–restore-last-session

You then have the option of starting Chrome normally and going to the default home page or starting Chrome with all your tabs from last time by clicking the desktop shortcut.

Increase privacy

Incognito mode is a great way to browse the web without your identity or history being used by websites. You are not completely anonymous, but it helps a lot. To hide even more of your online activities, use these command line switches:

–incognito –no-referrers

Websites can tell where you came from, basically the website you were previously looking at, and –noreferrers hides this information. Websites may look at where you came from, the referrer, when analysing traffic, which is mostly harmless, but this prevents it if you prefer to keep this information private.

Enable Chrome dark mode

Chrome has a dark mode and it can be enabled using a command line switch:

–force-dark-mode

It makes the browser dark, not web pages, which use their own colour schemes. There is no dark mode in Chrome’s menu or settings right now, but this command line switch still enables dark mode, so it could be coming soon to Chrome settings.

A comprehensive list of command line switches can be found here but beware, it’ll blow you mind! There are just too many and most of them are not useful to ordinary folk.


What's next?