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.

  dhan said:
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

    • every time.... why can't I install windows 11 on my 8088?
    • No word on how much of an ewaste apocalypse this will cause.
    • The list of Mac devices rumored to get macOS 26 by Hamid Ganji Apple will announce macOS 26 or macOS Tahoe at its Monday Worldwide Developers Conference. As has been reported multiple times over the past weeks, all Apple operating systems will receive a UI overhaul, a touch of AI, and new names at this year's WWDC. The logic behind the "26" in the new macOS version is that Apple aims to align its naming schedule with its 2025-2026 release cycle. The same version number will also appear across iOS, iPadOS, watchOS, and tvOS. While skipping multiple software versions raises many questions, it might help maintain consistency in the Apple ecosystem. With just two days away from the WWDC kick-off, many Mac owners might wonder if the upcoming macOS 26 is compatible with their devices. Here's the rumored list of compatible Mac devices with the macOS 26: MacBook Air (M1 and later) MacBook Pro (2019 and later) iMac (2020 and later) Mac Mini (M1 and later) Mac Studio (all models) Mac Pro (2019 and later) This report comes from MacRumors, which cites a private account on X as the source. However, the interesting thing about this list is that, according to the leaker, Apple might end software support for the MacBook Pro 13-inch (2020 model, two Thunderbolt 3 ports). For now, we should take this claim with a pinch of salt. The 2020 MacBook Pro 13-inch launched with both Intel and Apple Silicon M1 processors. It also comes with two port configurations. Apple is expected to end support for more Intel-based Mac devices this year, and this specific MacBook Pro variant might also be on Apple's kill list. WWDC 2025 kicks off on June 9, and Apple will unveil the latest version of its operating systems with an overhauled UI and a slew of AI-related features. So far, we know what Apple Watch models might get watchOS 26. Apple will announce the compatibility list of various devices at Monday's event.
    • It's a separate question to the thread, but I have VLC and qBitorrent working on W11 without any issue. Download->install->job done.
    • Currently I am using Display Port connection to monitor.   If I change the setting you show above it does make text larger, but ALL text larger not just icon text on desktop. Also is doesn't change the text weight at all. That setting leaves it very thing test. I want bold, or semibold.
  • Recent Achievements

    • Week One Done
      abortretryfail earned a badge
      Week One Done
    • First Post
      Mr bot earned a badge
      First Post
    • First Post
      Bkl211 earned a badge
      First Post
    • One Year In
      Mido gaber earned a badge
      One Year In
    • One Year In
      Vladimir Migunov earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      490
    2. 2
      +FloatingFatMan
      258
    3. 3
      snowy owl
      249
    4. 4
      ATLien_0
      223
    5. 5
      +Edouard
      190
  • Tell a friend

    Love Neowin? Tell a friend!