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

    • Absolutely NOBODY has suggested such a conclusion. I am affirming the sober reality check that AV2's overall market adoption will take longer than AV1's adoption rate -- which, by the way, is the whole point of the article! While PCI-SIG is productive (on paper), other WGs have created all sorts of confusing progress plans that consumers have tuned-out of their improvements... HTML/W3C, USB, HDMI, BT, WIFI (ieee802.11) as a few other groups where spec naming conventions, split progress paths, overlapping ambitions... I'm not critiquing the AV specs group; I'm simply affirming that adoption for AV2 faces headwinds beyond the macroeconomics of it all.
    • Segra 1.5.2 by Razvan Serea Segra is a free, open-source OBS-powered game recorder offering fast gameplay capture, instant clips, AI highlights, deep game integration, and seamless uploads—perfect for gamers, streamers, and content creators. Lightweight, fast, zero bloat. Segra key features: Automatic Game Recording: Begin capturing gameplay the moment your game launches, with zero manual setup. Instant Clipping: Save important moments instantly using a customizable hotkey—perfect for highlights, montages, or quick shares. Segra AI Highlights: Let Segra automatically detect kills, assists, deaths, and key events to generate polished highlight reels without manual editing. Gameplay Uploads: Upload recordings and clips directly to Segra.tv for fast sharing and cloud access. Deep Game Integration: Enjoy advanced game-data tracking across hundreds of supported titles, enabling smart highlight generation and stat-informed clipping. High-Performance Capture: Record up to 4K at 144 FPS using OBS-powered technology with minimal performance impact, supporting NVENC, AMD VCE, and custom quality controls. Segra Editor: Edit recordings easily with timeline controls, segment management, and event-based navigation to build the perfect clip. Customization Options: Adjust hotkeys, output formats, storage paths, codecs, capture quality, and performance settings for a tailored recording experience. Segra 1.5.2 changelog: Settings: Added an Airplane Mode that hides account, login, and upload features. Storage: Added a button to migrate videos into the recording path after changing it. Import: Added auto-scroll and a highlight pulse to videos right after importing. Recording: Added graceful handling of low disk space and output failures, finalizing files safely with clear errors. Recording: Added a guard blocking recording when any drive exceeds 99% full. OBS: Removed the download timeout to support users with slow internet. Clips: Fixed an error modal incorrectly appearing when clip creation was cancelled. Settings: Fixed the content folder path not refreshing in the UI after changes. Updates: Improved error handling for multiple simultaneous update checks. Stability: Fixed a WebSocket reconnect loop that ran while the window was backgrounded. Dependencies: Updated project dependencies. Maintenance: Removed dead code, reduced duplication, and fixed several latent bugs. Download: Segra 1.5.2 | 73.1 MB (Open Source) View: Segra Homepage | Github | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • No thanks! WebView trash is unacceptable. I only use software that's native.
  • Recent Achievements

    • Collaborator
      Asgardi earned a badge
      Collaborator
    • 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
  • Popular Contributors

    1. 1
      +primortal
      465
    2. 2
      PsYcHoKiLLa
      244
    3. 3
      Skyfrog
      79
    4. 4
      FloatingFatMan
      70
    5. 5
      Michael Scrip
      60
  • Tell a friend

    Love Neowin? Tell a friend!