Google Chrome Command Line Switches

Chrome supports a variety of command line switches that can be used to start Chrome in a specific manner or even extend its functionality.

In order to instruct the browser to do something different from the standard behavior, command line switches are used with the actual executable.

Some switches are useful for developers, while others are useful for IT professionals or even for ordinary users.

Google Chrome Command Line Switches 1

In this article, we will discuss various Chrome command-line switches and how they can be used to accomplish various tasks.

How to add command-line switches to Chrome executable

The easiest way to open Chrome with command-line switches is to run it from Command Prompt or Run Dialog. If, for example, you wish to open Chrome without any plugins, you can run the following command:

C:\Program Files\Google\Chrome\Application\chrome.exe --disable-plugins

If you would like to add a switch permanently to Chrome, you can do so by adding it to the Chrome shortcut.

To add the command-line switch to Chrome shortcut, right-click on the Chrome shortcut and select Properties. 

TIP: The default location for the Chrome Start Menu shortcut in Windows 10 is:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs

Under the Shortcut tab, append the command-line switch at the end of the Target field. For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-plugins

Once you have saved this shortcut, the browser will open without installing any plugins.

Some useful Chrome command-line switches

Set Chrome as the default browser

"Chrome executable path" --make-chrome-default
Or
"Chrome executable path" --make-default-browser

For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" --make-chrome-default

Take screenshots of the sites from command-line

With Chrome, you can take a screenshot of the website without even opening the browser. In a script, you can use this command to take screenshots of a website at intervals of x seconds.

You can use this to monitor a website’s user interface.Chrome must be running in headless mode in order to capture screenshots. You can accomplish this by using the following command (run in Command Prompt or Run dialog):

"Chrome executable path" --headless --screenshot="Save image path" "URL of the website"

Here is an example:

"C:\Program Files\Google\Chrome\Application\chrome.exe" --headless --screenshot="C:\Users\itechtics\Pictures\chrome-capture.jpg" "https://www.itechtics.com/chrome-command-line-switches/"

You can also specify the window size so the screenshot is taken from that specific window.

"C:\Program Files\Google\Chrome\Application\chrome.exe" --headless --screenshot="C:\Users\itechtics\Pictures\chrome-capture.jpg" --window-size=1200,3000 "https://www.itechtics.com/chrome-commandline-switches/"

Disable Google account sync

"Chrome executable path" --disable-sync

For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-sync

Enable night light

If you are working in a dark environment, enabling night light will help reduce eye strain.

"Chrome executable path" -ash-enable-night-light

For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" --ash-enable-night-light

Run Chrome in Safe mode/incognito mode

Chrome Safe Mode is incognito mode. Starting Chrome in incognito mode will enable the user to run Chrome in safe mode without loading any plugins.

"Chrome executable path" -incognito

For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" --incognito

Disable background apps

"Chrome executable path" --disable-background-mode

For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-background-mode

Start Chrome maximized

"Chrome executable path" --start-maximized

For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" --start-maximized

Disable GPU acceleration

"Chrome executable path" --disable-gpu

For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-gpu

Disable plugins

"Chrome executable path" --disable-plugins

For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-plugins

Disable DNS prefetch

"Chrome executable path" --dns-prefetch-disable

For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" --dns-prefetch-disable

Restore last session

"Chrome executable path" --restore-last-session

For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" --restore-last-session

Turn websites into apps

"Chrome executable path" –-app="https://www.itechtics.com"

For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" –-app="https://www.itechtics.com"

Mute audio

"Chrome executable path" –-mute-audio

For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" –-mute-audio

Force dark mode

"Chrome executable path" –-force-dark-mode

For example,

"C:\Program Files\Google\Chrome\Application\chrome.exe" –-force-dark-mode

For the complete list of Chrome command-line parameters, you can visit peter.sh.

You can use these switches in combination too. That means you can use two or more switches on the same command line. You can create different Chrome shortcuts to run Chrome with different command line switches. I hope these switches will make you more productive while using the browser. Do you want to know about a specific switch? Tell us in the comments below.

If you liked this post, Share it on:
Usman Khurshid is a seasoned IT Pro with over 15 years of experience in the IT industry. He has experience in everything from IT support, helpdesk, sysadmin, network admin, and cloud computing. He is also certified in Microsoft Technologies (MCTS and MCSA) and also Cisco Certified Professional in Routing and Switching.

Leave the first comment

Get Updates in Your Inbox

Sign up for the regular updates and be the first to know about the latest tech information