How to Use a Command-Line Switch on Windows 10

To use a command-line switch on Windows 10, launch a program's executable file followed by the switch it supports. For example, Chrome can be started in Incognito mode with --incognito. Use Command Prompt when you need the option once, or add the same switch to a desktop shortcut when you want a reusable launch option.

The important rule is that the application defines its own switches. Windows does not make a random /, -, or -- option work for every program. Check the app's official documentation before using a switch. Microsoft's command-line syntax guide also explains how Windows documentation represents required and optional arguments.

What is a command-line switch?

A command-line switch is an argument added after a program name to change how that particular launch behaves. It can open a special mode, select a file or profile, enable logging, or change another startup setting. The exact syntax is application-specific.

"C:\Path With Spaces\app.exe" --switch

If the executable path contains spaces, wrap the path in quotation marks. Put the switch after the closing quote, separated by a space. Do not assume that --switch, -switch, and /switch are interchangeable.

Some programs show their supported options when run with /?, -h, or --help, but this is not universal. The safest source is the program's own documentation.

Method 1: Run a command-line switch from Command Prompt

1. Open Command Prompt

Open Start, type cmd, and select Command Prompt. You normally do not need administrator rights unless the application or action itself requires elevation. Microsoft's cmd documentation describes the Windows 10 command interpreter and its own parameters.

Windows 10 Start search showing Command Prompt beside an open Command Prompt window
Open Command Prompt from Start before entering the application command.

2. Find the executable you want to launch

Locate the program's .exe file in File Explorer and copy or note its full path. Installation folders vary by application, Windows architecture, and how the program was installed, so do not copy a path from a guide unless it matches your PC.

File Explorer open to Google Chrome Application folder with chrome.exe selected
Find the actual executable on your PC; this example shows chrome.exe in the Chrome Application folder.

3. Type the executable path followed by the switch

For Chrome, Chromium's current source still defines incognito as the switch that launches the browser in Incognito mode. A typical command is:

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

If Chrome is installed elsewhere, replace the path with the location on your system. Chromium also documents the general Windows pattern of adding flags after the executable, while warning that many flags are intended for temporary or development use and can change. See the Chromium flag guide and the Chromium switch source.

Command Prompt running Chrome with the --incognito command-line switch
Keep the executable path in quotes and place --incognito after the closing quote.

4. Press Enter and verify the result

Press Enter. If the switch is valid, the application should start with the requested behavior. If nothing changes, recheck the spelling, dashes, spacing, executable path, and whether the installed version actually supports that option.

Google Chrome Incognito window opened after launching Chrome with the switch
The example command opens a Chrome Incognito window.

Method 2: Save the switch in a desktop shortcut

A shortcut is useful when you want the same launch behavior repeatedly without typing the command every time.

1. Create a shortcut for the executable

Right-click an empty area of the desktop and choose New > Shortcut. Microsoft also documents desktop shortcut creation through Windows. Browse to the application's executable or type its path, then finish the wizard. See Microsoft's desktop shortcut instructions.

Windows 10 desktop context menu with New and Shortcut selected
Choose New and then Shortcut from the Windows 10 desktop context menu.
Create Shortcut wizard pointing to the Chrome executable in Program Files
Point the shortcut wizard to the program executable installed on your PC.

2. Add the switch to the Target field

Right-click the new shortcut, choose Properties, and open the Shortcut tab. In Target, leave the quoted executable path unchanged. After the final quotation mark, type one space and then the switch:

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

Click Apply and OK. The switch must remain outside the quotes; otherwise Windows may interpret it as part of the file path.

Google Chrome shortcut Properties showing --incognito after the quoted executable path
Append the switch after the quoted executable path in the shortcut Target field.

3. Rename and use the special shortcut

Give the shortcut a descriptive name such as Chrome Incognito. Opening that shortcut will pass the switch each time, while your normal Chrome shortcut can still launch the browser normally.

Windows 10 desktop with separate Google Chrome and Chrome Incognito shortcuts
Keep a normal shortcut and a separate switch-enabled shortcut when you need both launch modes.

Common command-line switch mistakes

  • Using an unsupported switch: options belong to the application, not to Windows in general.
  • Putting the switch inside quotation marks: quote the executable path only, then add a space and the switch.
  • Using the wrong prefix: some programs use /, some use -, and others use --.
  • Assuming the effect is permanent: a switch normally changes only launches that include that argument. A shortcut makes the argument repeatable, but it does not rewrite the application's global settings.
  • Following an old list of switches: application options can be removed or changed, so verify them against current first-party documentation.

Does this still apply to Windows 10?

Yes. These command-line and shortcut techniques still work on Windows 10 systems. However, Microsoft ended standard Windows 10 support on October 14, 2025. If you still use Windows 10, review Microsoft's Windows 10 end-of-support guidance for supported upgrade or Extended Security Updates options.

Leave a Comment

How to Create a List of All Items in a Folder on Windows 10

How to Create a List of All Items in a Folder on Windows 10

Create a searchable Windows 10 folder inventory with PowerShell. Save every file and subfolder path as plain text or export details to a sortable CSV.

How to Display Custom Text on Your Windows 10 Desktop

How to Display Custom Text on Your Windows 10 Desktop

Add a custom reminder, quote, or label to your Windows 10 desktop with a Rainmeter text skin. Create the INI file, load it, then adjust its font and position.

How to Use Bluetooth Swift Pair on Windows 10

How to Use Bluetooth Swift Pair on Windows 10

Use Bluetooth Swift Pair on Windows 10 to pair a compatible accessory from a notification, with setup steps and fixes when the prompt does not appear.

How to Identify Function Key Symbols on a Windows 10 Laptop

How to Identify Function Key Symbols on a Windows 10 Laptop

Learn what common laptop function key symbols mean, how Fn and Fn Lock affect them, and how to confirm the right shortcut for your Windows 10 laptop model.

How to Put the Windows 10 Screen to Sleep on Demand

How to Put the Windows 10 Screen to Sleep on Demand

Turn off your Windows 10 display instantly with ScreenSleep, set a keyboard shortcut, and see when to use the built-in screen timeout instead.

How to Fix “Running Scripts Is Disabled on This System” in PowerShell on Windows 10

How to Fix “Running Scripts Is Disabled on This System” in PowerShell on Windows 10

Fix the “running scripts is disabled on this system” PowerShell error on Windows 10 with a current-user policy, a temporary session option, and safe steps for downloaded scripts.

How to Change the Drag Selection Color in Windows 10

How to Change the Drag Selection Color in Windows 10

Change the Windows 10 drag-selection color with a backup-first registry walkthrough, RGB examples, troubleshooting tips, and steps to restore your original values.

How to View All Devices Connected to Your Network on Windows 10

How to View All Devices Connected to Your Network on Windows 10

Check your router’s connected-device list or scan a local network with Fing Desktop on a supported PC. Learn what each method can show and how to verify unfamiliar entries.

Can You Get Alerts When a Facebook Messenger Friend Is Online?

Can You Get Alerts When a Facebook Messenger Friend Is Online?

Messenger does not offer a documented per-friend online alert. Learn how Active Status works, where to check the green dot, and which notifications you can enable instead.

How to Search an Archive File Without Extracting It on Windows 10

How to Search an Archive File Without Extracting It on Windows 10

Use 7-Zip to find an exact filename or wildcard match inside a ZIP or other supported archive on Windows 10 without unpacking its files.