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

Anixx

Member
Local time
4:32 AM
Posts
106
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

  • Operating System
    Windows 11

FreeBooter

Well-known member
Member
VIP
Local time
4:32 AM
Posts
368
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

  • Operating System
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Pavilion
    CPU
    AMD Ryzen 7 5700G
    Motherboard
    HP Pavilion Gaming Desktop TG01-2019nt
    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

Member
Thread Starter
Local time
4:32 AM
Posts
106
And how will I associate that shortcut with the file types?
 

My Computer

System One

  • Operating System
    Windows 11

johnlgalt

Antidisestablishmentarianistentarianist
Power User
VIP
Local time
8:32 PM
Posts
1,931
Location
3rd Rock
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

  • Operating System
    Windows 10 Pro X64
    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 GTX 970 SSC ACX 2.0 (04G-P4-3979-KB)
    Sound Card
    Realtek® ALC1220 Codec
    Monitor(s) Displays
    2 * Lenovo LT2323pwA Widescreeen
    Screen Resolution
    2* 1920*1080
    Hard Drives
    3x Sabrent Rocket PCIe Gen4 NVMe M.2 1 TB SSD (SB-ROCKET-NVMe4-1TB)
    SanDisk Ultra SDSSDHII-960G-G25 960 GB SATA III SSD
    Crucial MX100 CT256MX100SSD1 256GB SATA III SSD
    2 * Seagate Barracuda 7200.12 ST31000528AS 1TB 7200 RPM --> RAID1
    PSU
    PC Power & Cooling’s Silencer Series 1050 Watt, 80 Plus Platinum
    Case
    Fractal Design Define 7 XL Dark ATX Full Tower Case
  • 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