Opening Chrome From Command Line
Categories:
Opening Google Chrome from the Command Line on Windows
Learn how to launch Google Chrome directly from the Windows Command Prompt or a batch file, including opening specific URLs, incognito mode, and managing multiple profiles.
Opening applications from the command line can significantly boost productivity, especially for developers, system administrators, or anyone who frequently interacts with the command prompt. This article will guide you through the various methods and options for launching Google Chrome directly from the Windows Command Prompt (CMD) or a batch script, allowing you to automate tasks, open specific web pages, or manage different user profiles with ease.
Basic Chrome Launch
The simplest way to open Google Chrome from the command line is by calling its executable. By default, Chrome installs itself in a specific location on Windows systems. You'll need to know this path to execute it directly. If Chrome is in your system's PATH environment variable, you might be able to simply type chrome
or google-chrome
.
chrome.exe
.start chrome
Using 'start' command to launch Chrome (if in PATH)
"C:\Program Files\Google\Chrome\Application\chrome.exe"
Directly calling chrome.exe (default path)
Opening Specific URLs
One of the most common reasons to launch Chrome from the command line is to open a specific website. You can achieve this by simply appending the URL as an argument to the chrome.exe
command. You can also open multiple URLs at once, each in its own tab.
"C:\Program Files\Google\Chrome\Application\chrome.exe" https://www.google.com
"C:\Program Files\Google\Chrome\Application\chrome.exe" https://www.google.com https://www.stackoverflow.com
Opening single or multiple URLs
Advanced Launch Options
Chrome offers a plethora of command-line switches that allow for advanced control over its behavior. These switches can be used to open Chrome in incognito mode, with a specific user profile, or even in application mode (kiosk mode). Below are some of the most useful options.
Decision flow for advanced Chrome launch options
1. Launch in Incognito Mode
To open Chrome in incognito mode, which prevents browsing history, cookies, and site data from being saved, use the --incognito
switch.
2. Specify a User Profile
If you have multiple Chrome profiles, you can specify which one to use with the --profile-directory="Profile Name"
switch. Replace "Profile Name" with the actual folder name of your profile (e.g., Profile 1
, Default
). You can find profile folder names by navigating to chrome://version
and looking at the 'Profile Path'.
3. Open in Application Mode
To open a website in a dedicated, minimalist window without browser UI elements (like a web app), use the --app="URL"
switch. This is useful for creating shortcuts to web applications.
"C:\Program Files\Google\Chrome\Application\chrome.exe" --incognito https://www.privatebrowsing.com
"C:\Program Files\Google\Chrome\Application\chrome.exe" --profile-directory="Profile 1" https://mail.google.com
"C:\Program Files\Google\Chrome\Application\chrome.exe" --app="https://docs.google.com"
Examples of advanced Chrome launch commands