Is there a way to add a command-line switch to a program that runs from file associations?


Anixx

Active member
Member
Local time
11:43 AM
Posts
274
OS
Windows 11
For instance, I run a browser by clicking a link in a mail client. But I want that browser to always run with a command-line switch.
 

My Computer

System One

  • OS
    Windows 11

FreeBooter

Well-known member
Power User
VIP
Local time
11:43 AM
Posts
765
OS
Windows 11
You can create a shortcut for the program you want to execute command line or open Properties page of the shortcut and from Shortcut tab you can add the command line you want to execute.



2021-10-18_17-58-28.png
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Pavilion
    CPU
    AMD Ryzen 7 5700G
    Motherboard
    Erica6
    Memory
    Micron Technology DDR4-3200 16GB
    Graphics Card(s)
    NVIDIA GeForce RTX 3060
    Sound Card
    Realtek ALC671
    Monitor(s) Displays
    Samsung SyncMaster U28E590
    Screen Resolution
    3840 x 2160
    Hard Drives
    SAMSUNG MZVLQ1T0HALB-000H1

Anixx

Active member
Member
Thread Starter
Local time
11:43 AM
Posts
274
OS
Windows 11
And how will I associate that shortcut with the file types?
 

My Computer

System One

  • OS
    Windows 11

johnlgalt

Antidisestablishmentarianistentarianist
Power User
VIP
Local time
4:43 AM
Posts
2,423
Location
3rd Rock
OS
Windows 11 21H2
For your specific case with the browser for running mail, since you're specifically using the browser, you can look into Browser Chooser 2, which I use to hand pick which browser opens which links that get passed to it as the default URL handler in Windows.

You can have as many items as you want, up to a width of 10 per row, and can have the same item more than once (i.e. Edge and another Edge for the same profile but with special parameters passed to it).

If you need help setting it up, let me know, I've been using it for years, and can probably help get you where you want to be with it.

If you're talking about a lot of different programs, though, i haven't actually tried to use BC2 for anything else other than URLs and web pages. Theoretically, it should work, since you can use the settings to add the application to the default apps list, and then assign it for numerous file types and protocols, but I don't know if Windows 11 will allow you to set it as default for protocols it hasn't actually registered itself as the handler for.

Check it out and see. May be what you're looking for.

 

My Computers

System One System Two

  • OS
    Windows 11 21H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    HomeBrew
    CPU
    AMD Ryzen 9 3950X
    Motherboard
    MSI MEG X570 GODLIKE
    Memory
    4 * Corsair Vengeance 32 GB 3600 MHz
    Graphics Card(s)
    EVGA GeForce RTX 3080 Ti XC3 ULTRA GAMING (12G-P5-3955-KR)
    Sound Card
    Realtek® ALC1220 Codec
    Monitor(s) Displays
    Eve Spectrum ES07D02 280 Hz QHD | Eve Spectrum ES07D03 4K Gaming Monitor
    Screen Resolution
    1440p | 4k
    Hard Drives
    3x Samsung 980 Pro NVMe PCIe 4 M.2 2 TB SSD (MZ-V8P2T0B/AM)
    PSU
    PC Power & Cooling’s Silencer Series 1050 Watt, 80 Plus Platinum
    Case
    Fractal Design Define 7 XL Dark ATX Full Tower Case
    Cooling
    ZXT KRAKEN Z73 73.11 CFM Liquid CPU Cooler (3x 120 mm push top) + Air 3x 140mm case fans (pull front) + 1x 120 mm (push back) and 1 x 120 mm (pull bottom)
    Keyboard
    SteelSeries Apex Pro Wired Gaming Keyboard
    Mouse
    Logitech MX Master 3 for Business
    Internet Speed
    Logitech MX Master 3 for Business
    Browser
    Nightly (default) + Firefox (stable),Chrome, Edge/ß/Dev/Canary
    Antivirus
    Defender
  • Operating System
    Windows 10 x64 Pro build 21H1
    Computer type
    Laptop
    Manufacturer/Model
    Dell Latitude E5470
    CPU
    Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz, 2501 Mhz, 2 Core(s), 4 Logical Processor(s)
    Motherboard
    Dell
    Memory
    16 GB
    Graphics card(s)
    Intel(R) HD Graphics 520
    Sound Card
    Intel(R) HD Graphics 520 + RealTek Audio
    Monitor(s) Displays
    Dell laptop display 15"
    Screen Resolution
    1920 * 1080
    Hard Drives
    Toshiba 128GB M.2 22300 drive
    INTEL Cherryvill 520 Series SSDSC2CW180A 180 GB SATA III SSD
    PSU
    Dell
    Case
    Dell
    Cooling
    Dell
    Mouse
    Logitech MX Master (shared) | Dell TouchPad
    Keyboard
    Dell
    Internet Speed
    AT&T LightSpeed Gigabit Duplex
    Browser
    Edge Chromium | Chrome | Firefox Nightly | Brave
    Antivirus
    Defender + MB4
Top Bottom