List of Google Chrome command line switches
Google Chrome supports hundreds of different command line switches (or flags) that may add features to the browser, change how features work, or remove features from it.
Some switches are only useful to developers as they enable them to test certain features in Chromium, while others have practical uses that users of the web browser will appreciate as well.
List of Google Chrome Command Line Switches
The following list highlights important Chrome command line switches for users of the Google browser.
Chromium Command | Description |
---|---|
--ash-force-desktop | Forces uses of the desktop version of Chrome |
--disable-3d-apis | Disables 3D APIs, including WebGL and Pepper 3D |
--disable-accelerated-video | Disables GPU accelerated video |
--disable-background-mode | Background apps won't continue to run when Chrome exits. |
--disable-gpu | Disables hardware acceleration using the GPU |
--disable-plugins | Prevents all plugins from running |
--disable-plugins-discovery | Disables the discovery of missing plugins |
--disable-preconnect | Disables speculative TCP/IP preconnections |
--disable-translate | Disables the Google Translate feature |
--dns-prefetch-disable | Disable DNS prefetching |
--enable-kiosk-mode | Kiosk Mode for Chrome OS |
--incognito | Launches Chrome directly in Incognito private browsing mode |
--media-cache-size | Disk space used by media cache in bytes |
--multi-profiles | Enable multiple profiles in Chrome |
--new-profile-management | Enable the new profile management in Chrome |
--no-experiments | Run Chrome without experiments set in chrome://flags |
--no-pings | No hyperlink auditing pings |
--no-referrers | Use Chrome without sending referrers |
--purge-memory-button | Add purge memory button to Chrome |
--reset-variation-state | Change the field trials that the browser is currently signed up for |
--restore-last-session | Restore the last session on run |
--ssl-version-min | Specify the minimum SSL version accepted |
--start-maximized | Starts the Chrome window maximized. |
--window-position | Specify the initial window position using --window-position=x,y |
--window-size | Specify the initial window size using --window-size=x,y |
For a full list of switches, visit this blog post by Peter Beverloo.
How to Use a Command Line Switch in Chrome?
For the uninitiated, I'd like to walk you through the configuration process that explains how you can add one or multiple command line switches to the Chrome browser on Windows.
You have two main options to execute command line switches on Chromium. First, you can open the Windows command line, change the directory to the Chrome directory, and run commands using chrome.exe, followed by the commands that you want to run.
An example would be the following command executed in the Chrome application directory on the system:
chrome.exe --reset-variation-state
The second and the easier way to add a flag to Chrome is the following:
- Tap on the Windows-key, type cmd and hit enter.
- Use CD to change the directory to your Chrome profile directory.
- If you are running Windows XP, it is %USERPROFILE%\Local Settings\Application Data\Google\Chrome\Application
- If you are running Windows Vista or newer, it is %LOCALAPPDATA%\Google\Chrome\Application
- Type chrome.exe followed by the space-key, and then the command line switches you want to run. Note that they always begin with two dashes.
This is great for testing purposes, but if you like a certain command and want to run it at all times, you may want to make those changes permanent so that they are automatically used whenever you load Chrome.
Adding Chrome Switches to Desktop Shortcuts/Icons
If you are starting Google Chrome from a shortcut that is placed on the desktop, taskbar or start menu, then you can easily add command line switches to it. Just right-click the shortcut, locate Google Chrome there, right-click on it and select Properties.
The Shortcut tab should open up automatically. It displays the load path of the browser in the target field. At the end of the field, after the closing ", add a space, and then the command line switch you want to use. You can add multiple switches, one after the other separated by a single space. For example, this is useful if you want to create a Chrome icon that directly opens the Incognito mode. Just insert the incognito command line flag into the shortcut target and you are done.
OH, I thought of a quick follow up comment. I think how the taskbar manages icons is a general problem with Windows 11. Usually Windows does not separate different instances of an app into more than one icon. Example: File Manager. If you start two or more instances of File Manager, they all end up under one icon. You have to hover the mouse over the icon in order to select the instance that you need at a given time. What a pain. It would be very helpful if you could force Windows to separate instances of a given app onto more than one icon. OR just be able to right click one of the taskbar icons and ask Windows to SEPARATE them.
You can use third party programs like https://github.com/valinet/ExplorerPatcher to achieve the functionality you want. CAUTION: I make no promises about the safety of any links or third party software. Do your own research and use at your own risk.
I’m assuming you are in Windows and I have a couple of suggestions for you.
#1 instead of using –user-data-dir, you might consider using *actual* profiles (for which chrome provides a nice GUI). With actual profiles, chrome can automatically create separate shortcuts (each with a custom icon) for each profile. Those shortcuts can then be individually “pinned to taskbar” and when opening chrome using those shortcuts, the corresponding windows should stay “stacked” under the correct icon/shortcut in the taskbar.
#2 The likely underlying cause for your windows sometimes stacking under a single icon, and sometimes multiple, is because the shortcuts you have made likely do not have the correct “AppUserModelId” assigned. Windows (I think from 7+) uses this property of WINDOWS and FILES (including .lnk shortcut files) to figure out which WINDOWS to stack on which SHORTCUTS/icons in the taskbar.
With a default installation of chrome with a single profile and single user-data-dir, all shortcuts and windows get the AppUserModelId “Chrome”.
With multiple user-data-dirs and one *acutal* profile per user-data-dir the WINDOWS will get an AppUserModelId like “Chrome.{user-data-dir value}.Default”. However, if you create your shortcuts using the file explorer or a script, then their AppUserModelId will still just be “Chrome”. That means default chrome windows *could* still get stacked on the icons you want to be custom and that custom windows may not stack on their icons (they might show up with separate “running” icons from the static pinned icon).
To fix this, create your shortcuts by running chrome with the user-data-dir and profile-directory command line options you want, then right-clicking the RUNNING icon and pinning THAT to the taskbar. Then close the window you just opened. Now hold “shift” key and right-click the new taskbar shortcut. Then select “properties”. You’ll notice that the “target” box for this shortcut likely does not have the command line options you used to start the program in the first place… that ok, we only did this to get the shortcut to have the same AppUserModelId as the WINDOW will have each time it runs. Go ahead and modify the shortcut to use all of the command line options you want. You can also modify the icons themselves to make each shortcut easy to distinguish.
I had to figure out how to do this so that I could have a default chrome and a chrome that goes through a proxy without changing the system proxy settings. For my use case, I actually did use a separate user-data-dir because I wanted to customize the icon. But if you are fine using the profile-specific icons Chrome generates, then I think you can just do it with normal profiles (and auto-generated shortcuts or the profile-directory command line option). The reason I recommend using Chrome’s actual profiles instead of separate user-data-dirs if you don’t need to is because:
– chrome will create the shortcuts for you
– chrome will create the icons for you
– chrome will (I think) make sure the windows stack on icons in the taskbar properly
– chrome provides a nice, easy way to switch a window from one profile to another without having to completely close the window or open a separate window.
I should have made this clearer… the “fix” in “#2” is only there as a manual option if:
– you decide you need to user user-data-dir instead of actual profiles
– you decide to use actual profiles but for some reason the auto-generated shortcuts aren’t working properly.
This is September and is the first time I’ve used this list. Hoping it’s ok to post 3 months after the last post. Reading the list questions and looking at the command line options, I have clearly not figured everything out.
I use several profiles in order to separate the tasks and purposes that I implement with Chrome. I have always use the primary Windows storage location and not the users\username location. AND I always configure each case using a shortcut. Here is an example of a Windows 11 command line from one of my shortcuts:
“C:\Program Files\Google\Chrome\Application\chrome.exe” –user-data-dir=p:\CHRM
I implement every unique profile using this approach, and it works very well. In this case, p is an encrypted drive. So I mount the drive, and start Chrome using the shortcut, and then unmount the drive when I’m done. I assume that everything I do in a particular session ends up in p, and is protected, essentially not accessible to anyone who might gain access to my computer. There is nothing major that needs to be fixed with this approach, as far as I know.
There is one (silly?) problem with this that I would really like to fix. With each instance of Chrome using a different profile, Windows usually puts a new icon in the task bar, so I can see every unique profile that I have started. The problem is that Windows or Chrome does not always start a new instance of Chrome using a different icon — i.e. occasionally there is one icon that is managing more than one instance of Chrome. This is IMPORTANT to me since I can have up to 10 or so copies of Chrome running. It is really inconvenient to have to remember where all of them (which are being used for different tasks or projects) are located. If you forget, you have to run your mouse down the taskbar, hover over each icon, to find out which one is managing more than one unique task.
I have not been able to figure out a setting that FORCES Windows and/or Chrome to create a unique icon for each unique task. Are there any ideas about how to do this, hopefully with the use of another command line switch.
TIA Richard Dent.
How to use –start-maximized switch on Mac OS? It seems to work only on Windows OS
How to change to download folder location for a given session from the command line ?
Yes
Any way to temporarily change the download folder for the session you’re launching from the command line?
how to open a minimized window?
Never mind, I fixed it myself. The reason I needed to open a minimized window using chromium command line switches was so that I could open it up with a batch file. However, I couldn’t find a chromium command line switch that would suit my purpose, so I made a .vbs file that simulated the keystrokes of manually minimizing a page after it’s open(ALT+SPACE+N) using the Wshshell.Sendkeys method and then coded my batch file to open a new window and then run the .vbs file.
is there any example i can use if i want to have (chrome.exe -no same adress http://test.com ) the argument is when the http://test.com is open , it will NOT open again in a new tab
Hi,
Is there a way to open two tabs in the –app mode?
For example:
chrome.exe -–new-window –app=google.com app=yahoo.com –new-tab
I am trying to open a webpage in kiosk mode and at the same time, I am loading a virtual keyboard unpacked extension to Chrome. The challenge is that when the webpage opens in kiosk mode, the same time the extension settings page also opens up on top of it. I have also tried closing that extension setting tab using sendkey (Ctrl+4 and Ctrl+W) but it closes the complete chrome instance. Here is the vb script that I am using.
Set WshShell = WScript.CreateObject(“WScript.Shell”)
WshShell.run (“chrome.exe –kiosk http://gmail.com –load-extension=C:\LAUNCHER\keyboard”)
WshShell.AppActivate (“Chrome.exe”)
WScript.Sleep 3000
‘WshShell.sendkeys (“^W”)
Any help will be appreciated.
Ouch… I realize that I’m answering this post a year after it’s posted.
hmm…
I just had the same problem. I was opening three tabs and wanted to close the first one. At first I tried using WshShell.Sendkeys (“W”) like you did, but the problem was it closed all three tabs. However, I fixed this by using:
WScript.Sleep 500
WshShell.SendKeys “^{F4}”
In your post, it says that you tried using Control+4, but I’m 99% sure that just takes you to the fourth opened tab if you have one(otherwise it does nothing). Using Control F4, however, is an alternate of using Control W, and it closes a tab. I’m not sure why Control F4 works and Control W doesn’t, but it might have something to do with the sleep statement.
Don’t forget to doskey your chrome taskkill and shortcut all of these. makes the little problems with having to kill manageable^
I am in need to start chrome with a certain width and height. If I use –window-size=800,600 anyway chrome will startup in full screen mode.
I searched the web and cannot find any handy parameters like in firefox like “-height 800 -width 480”
The “not honoring outside links” issue is still there, and it makes this feature of pretty limited usage for Windows users. No command line switch is worth having URL links in emails no longer function when Chrome is already running.
I had the same problem of Chrome not obeying command switches (–kiosk) at re-load, but if you use task manager and kill of ALL running Chrome processes before attempting a Chrome reload, it will restart in kiosk mode every time :-)
(Figured this out because it would work if auto-loaded after a reboot)
The processes remain when Chrome is not exited cleanly i.e.if Alt-F4 is used to exit kiosk mode
Am working on a simple way to overcome this.
So I’ve got a Chrome window open, and if I run “start chrome.exe -kiosk “http://localhost:3000” it doesn’t open it in Kiosk mode. However, if I run this w/ all Chrome windows closed, it works. This is unfortunate, as I’d love to start my app in fullscreen always, all the time. :/
Ekyl, google-chrome does not work… Try using –new-tab to open URL in a new tab rather than a new window.
Aaron, –new-window will open new windows and not new tabs.
EXAMPLE: chrome.exe http://www.google.com –new-tab
Daniel, –new-window will open new window AND new tabs if you specify mutiple address as Aaron mentioned
EXAMPLE: chrome.exe –new-window http://www.google.com http://www.ghacks.net
I’m not sure if it was available when this was written, but you can now disable just WebGL using:
–disable-webgl
Any way to specify the Chrome window title? I’m opening many different Chrome instances, each one with its own profile, to test a web app, with many accounts. So many Chrome windows make me confused. Window titles would be nice.
In my opinion, the most useful: -d
Opens a new tab with the specified destination, great for opening pages from the command line.
Example:
google-chrome -d drive.google.com
–new-window [url]
Opens a new window with the specified page (if an existing instance of Chrome was already running). You can specify multiple URLs and they will be opened as tabs in the new window.
@Martin – this is really useful , Thank you
Posting on an old thread here, but.. the problem with command line switches in Chrome (Windows) is once launched with one, no external links will work. In other words, if chrome is running and was launched using an command line argument–clicking, say, an html link in an email does nothing.
You can of course close the running instance of chrome, then the link will work (but it will launch chrome -without- args).
Nothing I’ve tried has fixed this, including explicitly setting Chrome as the default browser in Chrome://settings instead of in Windows internet settings. Same. Exact. Behavior.
Anyone using args with Chrome should be aware of this behavior–losing the ability to click an external link when chrome is active is a show stopper for me.
Thanks Martin, this was helpful. I’ve been through your instructions, but still not sure if the switch was applied. Is there a way to have Google tell me back what switches are on?
…and this one is very handy if you want to use Netflix in your browser without being prompt to download Netflix app on Windows 8 :
–user-agent=”Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0″
this way Netflix thinks you are running Windows 7 and doesn’t force you to get an app to continue.
Cheers.
I wish they would finally launch in Germany..
Martin… in the command description for –window-size, your example syntax specifies window-position, not window-size …shouldn’t it say:
Specify the initial window size using –window-size=x,y
Thank you, corrected!.
How can all this be added
Cannot be added to target
–window-position=0,0 –window-size=900,900 –incognito –no-referrers –disable-remote-fonts –disable-webgl –disable-reading-from-canvas –disable-webgl-image-chromium –disable-webgl2 –disable-zero-copy –disable-gpu –disable-zero-copy –disable-3d-apis –disable-accelerated-2d-canvas –disable-2d-canvas-image-chromium –disable-2d-canvas-clip-aa –disable-webrtc-encryption –disable-webrtc-hw-decoding –disable-webrtc-hw-encoding –block-third-party-cookies
You’ve got VPN service and fast internet- so why not use it ^^
Although i do get the point of Not-wanting-to-set-it-permanently that way.. But hey, if your broadband connection allows it- why not =]