Any way to launch the default browser from the command line?


Recommended Posts

Suppose if I set different or even multiple home pages for Firefox, IE, Chrome, Opera and Safari. Now if I set any one of those as the default browser, is there a way to open the default browser from the command line/run/script/batch file/powershell? There's one key here: HKEY_CLASSES_ROOT\http\shell\open\command but that appends "-nohome" to IE if I return that value in a script.

This is sort of cheating.. but, if you open up your Start Menu and drag the "Internet" shortcut from the top of the list out to the desktop, you then have an "Internet - Shortcut.lnk" file on your desktop. Just have your program call upon this shortcut.

This shortcut will update itself if the default browser on the system changes.

That shortcut is only there up to Vista. I'm on Windows 7. And start <URL> launches that specific URL. If I've set different homepages for each browser, it's not of use to me.

In Powershell

$registrykey = [Microsoft.Win32.Registry.ClassesRoot]::OpenSubKey("htmlfile\shell\open\command", $false)
[string] $browserpath = $registrykey.GetValue("", "").Split('"')[1]
[System.Diagnostics.Process]::Start($browserpath)

Just save it as a function and call it. You could also use the command in "http\shell\open\command". Just replace "htmlfile\..." with "http\..." and run.

Enter this on command line : start <some address>

such as start www.neowin.net

this works only if you place http:// in front of the address, otherwise windows says it can not locate the file!

None works. There are some classic VB examples here, some VB.NET examples here and some C# examples here but I'm not a dev. I don't want to launch a specific URL. I want to launch the default browser's set homepage whatever that may be.

The HKCU\Software\Clients\StartMenuInternet key is deprecated in Windows 7. While it exists, it may not be set by browsers in the future. Plus Chrome doesn't work as it puts a value of "Google Chrome" there instead of Chrome.exe. Also Opera doesn't work as Opera's app path isn't registered by default.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I do not remember anything happening to Apple and Google for bribing people not to make Apps for Windows Phone. Edge barley has a foot print to matter. If the other browser companies want more of the Pie, they need to do better. I use Brave on all my personal device. However in industry, Edge of default, as we can manage it easier with MS tools.
    • On the one hand, it shouldn't be difficult. You buy a computer, you decide what OS you want, which browser etc. Simple enough. But that's the techie side of things. My sister, my mother, wouldn't bother with such a thought. And I'm pretty sure that if you presented a window asking them what to pick they would say, "I don't care! I just want to access my Email!"
    • CPU-Z 2.20.2 by Razvan Serea CPU-Z is a freeware utility that gathers information on some of the main devices of your system. CPU-Z does not need to be installed, just unzip the files in a directory and run the .exe. In order to remove the program, just delete the files. The program does not copy any file in any Windows directory, nor write to the registry. CPU Name and number. Core stepping and process. Package. Core voltage. Internal and external clocks, clock multiplier. Supported instructions sets. All cache levels (location, size, speed, technology). Mainboard Vendor, model and revision. BIOS model and date. Chipset (northbridge and southbridge) and sensor. Graphic interface. Memory Frequency and timings. Module(s) specification using SPD (Serial Presence Detect) : vendor, serial number, timings table. System Windows and DirectX version. CPU-Z 2.20.2 changelog: Intel Arc G3 and G3 Extreme (Panther Lake)(2.20.2). AMD Ryzen 7 7700X3D (Raphael) (2.20.1). AMD Ryzen AI Max+ 495, 492, 488 (Gorgon Halo). AMD Ryzen AI Max 490, 485 (Gorgon Halo). AMD Ryzen AI Max PRO 495, 490, 485, 480 (Gorgon Halo). AMD Ryzen 9 9950X3D2 (Granite Ridge). AMD Ryzen 9 PRO 9965X3D, PRO 9945 (Granite Ridge). AMD Ryzen 7 PRO 9755, PRO 9745 (Granite Ridge). AMD Ryzen 5 PRO 9645 (Granite Ridge). AMD Ryzen AI 7/PRO 450G/GE (Gorgon Point 2). AMD Ryzen AI 5/PRO 440G/GE (Gorgon Point 2). AMD Ryzen AI 5/PRO 435G/GE (Gorgon Point 3). AMD Ryzen AI Max+ 392 (Strix Halo). Intel Core Ultra 5 250KF Plus (Arrow Lake Refresh). Intel Core 7 360 and 350 (Wildcat Lake). Intel Core 5 330, 320 and 315 (Wildcat Lake). Intel Core 3 304 (Wildcat Lake). Intel Core 9 273PQE, 273PTE, 273PE (Bartlett Lake). Intel Core 7 253PQE, 253PTE, 253PE, 251TE, 251E (Bartlett Lake). Intel Core 5 223PQE, 223PTE, 223PE, 221TE, 221E, 213PTE, 213PE, 211TE, 211E (Bartlett Lake). Intel Core 3 201TE, 201E (Bartlett Lake). Intel Arc Pro B70 and B65 (BMG-G31). Intel Arc Pro B60 and B50 (BMG-G21). Support of HUDIMM and HSODIMM memory modules. Download: CPU-Z 2.20.2 | Portable ~5.0 MB (Freeware) View: CPU-Z Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Anyone who expects MS to play fair is a complete idiot.
  • Recent Achievements

    • Conversation Starter
      mobandz earned a badge
      Conversation Starter
    • Apprentice
      fernan99 went up a rank
      Apprentice
    • One Month Later
      nothanks earned a badge
      One Month Later
    • One Month Later
      B2Proxy earned a badge
      One Month Later
    • One Year In
      MadMung0 earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      468
    2. 2
      PsYcHoKiLLa
      247
    3. 3
      Skyfrog
      79
    4. 4
      FloatingFatMan
      75
    5. 5
      Michael Scrip
      60
  • Tell a friend

    Love Neowin? Tell a friend!