October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Command Line

How to Open a URL in a Specific Browser (Windows, macOS, and Linux)

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To open a URL in a particular browser, launch that browser’s executable (or its operating-system launcher) and pass the URL as an argument. Use microsoft-edge: for Edge on Windows, open -a on macOS, and a browser command such as firefox or google-chrome on Linux. Commands such as start, open, and xdg-open without a browser name use the system default instead.

Choose between the default browser and a named browser

There are two different tasks:

  • Open with the default: give the operating system an http: or https: URL and let its registered handler decide.
  • Open with a specific browser: invoke that browser directly, or use a browser-specific URI scheme.

A default-browser command is convenient for scripts that should respect each user’s preference. A named-browser command is appropriate for testing, support instructions, automation, or opening a page in a browser with a particular profile or extension set. The browser must be installed, and executable names or paths can differ by distribution and installation method.

Windows: open a URL in Edge, Chrome, Firefox, or the default browser

Microsoft Edge

In Command Prompt, PowerShell, or the Run dialog, use the documented Edge URI scheme:

start "" "microsoft-edge:https://example.com"

The microsoft-edge: prefix selects Edge even when another browser is configured as the default. Keep the empty quoted argument after start; Windows treats the first quoted argument as a window title.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Logitech M185 Compact Ambidextrous 2.4 GHz Wireless Mouse - Swift Grey
  • Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
  • Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
  • Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
  • Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
  • Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)

Google Chrome

Pass the URL to Chrome’s executable. A common 64-bit installation path is:

"C:Program FilesGoogleChromeApplicationchrome.exe" "https://example.com"

Some installations are under Program Files (x86) or a user profile. If that path fails, locate chrome.exe and substitute its actual path. Once the executable directory is on PATH, you can usually run:

chrome "https://example.com"

Mozilla Firefox

"C:Program FilesMozilla Firefoxfirefox.exe" "https://example.com"

Use the installed path on your machine; enterprise and per-user installations can differ. Firefox accepts a URL as a command-line argument and opens it in an existing Firefox process when possible.

The Windows default browser

start "" "https://example.com"

Windows delegates ordinary http: and https: links to the registered default handler. An ordinary application generally cannot choose which registered application handles those schemes; use an explicit executable or Edge’s scheme when the browser matters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

PowerShell details

PowerShell can invoke a quoted executable path with the call operator:

Rank #2
Sale
Logitech G305 Lightspeed Wireless Gaming Mouse - Black
  • The next-generation optical HERO sensor delivers incredible performance and up to 10x the power efficiency over previous generations, with 400 IPS precision and up to 12,000 DPI sensitivity
  • Ultra-fast LIGHTSPEED wireless technology gives you a lag-free gaming experience, delivering incredible responsiveness and reliability with 1 ms report rate for competition-level performance
  • G305 wireless mouse boasts an incredible 250 hours of continuous gameplay on just 1 AA battery; switch to Endurance mode via Logitech G HUB software and extend battery life up to 9 months
  • Wireless does not have to mean heavy, G305 lightweight mouse provides high maneuverability coming in at only 3.4 oz thanks to efficient lightweight mechanical design and ultra-efficient battery usage
  • The durable, compact design with built-in nano receiver storage makes G305 not just a great portable desktop mouse, but also a great laptop travel companion, use with a gaming laptop and play anywhere
& "C:Program FilesGoogleChromeApplicationchrome.exe" "https://example.com"

For the default browser, use:

Start-Process "https://example.com"

Do not concatenate untrusted text into a command without validation. A URL containing shell metacharacters can change what the shell executes; pass it as a separate, quoted argument.

macOS: target Safari, Chrome, Firefox, or the default

Open in a named application

The open command selects an application by name:

open -a "Google Chrome" "https://example.com"
open -a Safari "https://example.com"
open -a "Firefox" "https://example.com"

The application name must match the installed app. If macOS reports that it cannot find the application, check the name in Finder’s Applications folder. The command normally reuses an existing browser process and creates a new tab or window according to that browser’s settings.

Open in the default browser

open "https://example.com"

This uses macOS’s default URL handler. Changing the default browser in System Settings changes where this command goes, but does not change an open -a command that names an app.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a full application path when names are ambiguous

open -a "/Applications/Google Chrome.app" "https://example.com"

Application names and paths containing spaces must be quoted. The macOS application launcher and browser protocol-handler registration are separate mechanisms: open -a is a one-off choice, while registration associates a scheme with an app for future activations.

Linux: launch a specific browser from a terminal

Firefox, Chrome, and Chromium

firefox "https://example.com"
google-chrome "https://example.com"
chromium "https://example.com"

Executable names depend on the package and distribution. Snap, Flatpak, or vendor packages may expose a different command; check the launcher installed by your package manager. To verify which command will run, use command -v firefox, command -v google-chrome, or command -v chromium.

Rank #3
Sale
Logitech M185 Compact Ambidextrous Wireless Mouse with Rubber Grips - Blue
  • Compact Mouse: With a comfortable and contoured shape, this Logitech ambidextrous wireless mouse feels great in either right or left hand and is far superior to a touchpad
  • Durable and Reliable: This USB wireless mouse features a line-by-line scroll wheel, up to 1 year of battery life (2) thanks to a smart sleep mode function, and comes with the included AA battery
  • Universal Compatibility: Your Logitech mouse works with your Windows PC, Mac, or laptop, so no matter what type of computer you own today or buy tomorrow your mouse will be compatible
  • Plug and Play Simplicity: Just plug in the tiny nano USB receiver and start working in seconds with a strong, reliable connection to your wireless computer mouse up to 33 feet / 10 m (5)
  • Better than touchpad: Get more done by adding M185 to your laptop; according to a recent study, laptop users who chose this mouse over a touchpad were 50% more productive (3) and worked 30% faster (4)

Open in the preferred or default application

xdg-open "https://example.com"

xdg-open intentionally opens a URL in the user’s preferred application, normally the configured default browser. It is therefore not a browser-selection command. Desktop environments may also provide gio open, but that likewise follows desktop associations unless you invoke a browser explicitly.

Keep the terminal usable

Many browser commands remain attached to the terminal. Add an ampersand in a shell when you want the prompt back:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
firefox "https://example.com" &

For scripts, capture the process ID if you need to monitor or terminate the browser. Avoid assuming that a new process means a new window: an already-running browser may handle the request through its existing instance.

Comparison of launcher methods

System Specific browser Default browser Executable path required? Scope
Windows start "" "microsoft-edge:URL" or an executable path start "" "URL" Only when invoking Chrome, Firefox, or another executable directly One-off launch
macOS open -a "App" "URL" open "URL" No for a correctly named app; yes if using a full path One-off launch
Linux firefox URL, google-chrome URL, or another executable xdg-open "URL" Usually no if the executable is on PATH; otherwise yes One-off launch
All systems Registered custom protocol handler Not applicable Registration determines the handler Persistent association for a scheme

Can a website force a link to open in a particular browser?

No ordinary webpage can reliably force an https: link to open in an arbitrary browser. The operating system and the user’s browser settings control ordinary web schemes. A site can offer a link, detect limited browser characteristics, or ask the user to continue in another app, but it cannot silently override the user’s choice.

Protocol handlers are different

Custom schemes such as web+music: can be registered to an installed application. Windows, Linux, and macOS support protocol handlers for installed web apps, and activation can involve user permission or a handler-choice prompt. A website can register a handler with navigator.registerProtocolHandler(), but activation navigates through the registered URL template; this is not unlimited control over arbitrary ordinary links.

Rank #4
Amazon Basics 3-Button USB Wired Mouse with Responsive Tracking, Plug & Play, Compatible with Windows and Mac, Black
  • Computer mouse for easily navigating a computer interface; click, scroll, and more
  • USB-A wired connection; if existing device only supports USB-C, an additional adapter will be required
  • High-definition (1000 dpi) optical tracking ensures responsive cursor control for precise tracking and easy text selection
  • 3 buttons offer effortless fingertip control
  • Plug-and-go ready for instant use

Use a custom scheme only when you control the application and its registration flow. For a normal web URL, document the appropriate command for each operating system instead of promising that a page can force a browser.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Reliable scripts and automation practices

Quote and validate the URL

Always quote the complete URL. Validate that it uses an expected scheme such as https: before passing user input to a shell. Reject newline characters and shell control characters when URLs come from forms, tickets, or external data.

Locate the executable rather than hard-coding one path

Windows installations vary by architecture and per-user versus system scope. Linux package formats vary even more. Prefer a configured executable path, an environment variable, or a lookup such as command -v instead of assuming one location.

Expect an existing browser process

Launching a command may hand the URL to an existing process. If a clean session is required for testing, use that browser’s documented profile or private-session options and isolate the profile directory; do not delete a user’s profile as a shortcut.

Handle headless and server environments

These desktop launchers require a graphical session. On a server without a display, use a supported headless browser automation stack or a screenshot service instead of expecting open, start, or xdg-open to display anything.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Acer Wireless Mouse for Laptop, 2.4GHz Computer Mouse 3 Adjustable 1600 DPI
  • 【Plug and Play for Home/Office/School】The wireless computer mouse features 2.4GHz connectivity, delivering a stable, interference-free connection up to 32ft. Designed for 𝐦𝐞𝐝𝐢𝐮𝐦 𝐭𝐨 𝐥𝐚𝐫𝐠𝐞 𝐬𝐢𝐳𝐞𝐝 𝐡𝐚𝐧𝐝𝐬, it ensures comfortable use all day. Simply plug in the USB-A receiver for instant pairing—no drivers needed. 📌📌 If the mouse isn’t suitable, place the USB receiver in the battery compartment and return both.
  • 【3 Levels Adjustable DPI】This travel USB mouse offers 3 adjustable DPI settings (800, 1200, 1600), allowing you to customize sensitivity for precise design work. Effortlessly switch to match your task and elevate your productivity. 📌 Please remove the film at the bottom of the mouse before use.
  • 【Effortless Browsing】Equipped with forward and backward buttons, this computer mice streamlines your workflow, making it easy to navigate through web pages and files with a simple click. 📌Side button does not work on Mac.
  • 【Visible Indicator Light】 The pc mouse features a visual indicator for DPI levels and low battery alerts. The red light flashes once for 800 DPI, twice for 1200 DPI, and three times for 1600 DPI. When the battery level is below 10%, the light flashes red until the mouse is completely out of power.
  • 【Click to Wake】With smart sleep mode, it saves power by standby after 10 inactive minutes, just 2-3 clicks to wake. This efficient design delivers 3x longer battery life than motion-wake mice. Engineered for durability, its buttons and scroll wheel are tested for 10 million clicks, ensuring long-term reliability and consistent performance.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common errors and fixes

  • “The system cannot find the path specified” (Windows): the executable path is wrong. Find the installed browser and update the quoted path, or add its directory to PATH.
  • Edge opens when you expected Chrome: you used start "" "URL" or another default-handler command. Invoke Chrome directly.
  • open -a says the app is unavailable: the app name does not match its installed name, or it is not in Applications. Use Finder’s exact name or a full .app path.
  • xdg-open chooses the wrong browser: that is its purpose—it follows the preferred handler. Call the desired browser executable instead, or change the desktop default.
  • Linux says “command not found”: the browser is not on PATH, has a different package command, or is not installed. Locate its launcher and use the full path.
  • The command returns but no window appears: the machine may be headless, the browser may be minimized, or an existing process may have consumed the request. Check the display session and browser process.
  • A URL opens incorrectly: quote it as one argument and ensure characters such as &, ?, and # were not interpreted by the shell.

Or skip the browser setup

If your goal is a rendered image or PDF rather than an interactive browser window, ScreenshotNeo returns a capture from one GET request. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each cleanup step can be disabled. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing result.

cURL:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

See the complete options and response details in the ScreenshotNeo documentation. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000, and every feature is available on every plan. Create a free ScreenshotNeo account.

FAQ

How do I open a link in Chrome instead of Edge on Windows?

Run Chrome’s executable with the URL, for example "C:Program FilesGoogleChromeApplicationchrome.exe" "https://example.com". Do not use the default-handler form start "" "https://example.com".

Can I make every link use one browser without changing the default?

Not for ordinary http: and https: links. Use explicit launch commands in the application or script that needs a particular browser; persistent system associations affect the default handler.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why does a browser command reuse an existing window?

Most browsers route command-line URLs to an already-running instance. If you need isolation, create a separate supported browser profile or automation session rather than assuming each command creates a new process.

Frequently Asked Questions

How do I open a link in Chrome instead of Edge on Windows?

Run Chrome’s executable with the URL, for example "C:Program FilesGoogleChromeApplicationchrome.exe" "https://example.com". Do not use the default-handler form start "" "https://example.com".

Can I make every link use one browser without changing the default?

Not for ordinary http: and https: links. Use explicit launch commands in the application or script that needs a particular browser; persistent system associations affect the default handler.

Why does a browser command reuse an existing window?

Most browsers route command-line URLs to an already-running instance. If you need isolation, create a separate supported browser profile or automation session rather than assuming each command creates a new process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

SaleBestseller No. 1
Logitech M185 Compact Ambidextrous 2.4 GHz Wireless Mouse - Swift Grey
Logitech M185 Compact Ambidextrous 2.4 GHz Wireless Mouse - Swift Grey
Product carbon footprint: 3.97 kg CO2e; Contoured shape: Gives you more comfort and control
$14.90
SaleBestseller No. 3
Bestseller No. 4
Amazon Basics 3-Button USB Wired Mouse with Responsive Tracking, Plug & Play, Compatible with Windows and Mac, Black
Amazon Basics 3-Button USB Wired Mouse with Responsive Tracking, Plug & Play, Compatible with Windows and Mac, Black
Computer mouse for easily navigating a computer interface; click, scroll, and more; 3 buttons offer effortless fingertip control
$9.70

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.