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

    • Lets assume that we are capitalists and right wing people for a sec. - The individual should be able to accrue wealth and no government should limit that wealth growth. - That same individual should not be taxed any higher than the average person. Tax is a socialist construct to help those in that country who are less fortunate, and it limits wealth growth. - This individual should be able to do whatever they want to do with their money and have no restrictions, as it would otherwise limit wealth growth. So having said all that with the mindset of a capitalist and small government political leaning, he can do what he want with it. Some billionaires have little pet projects to inflate their self worth like rocket ships and stuff, this is just a bit different is al, and probably the more compassionate of choices. I think he's seen a need, and that need isn't in the USA.
    • I'm concerned about this, too. How can he make sure that the money is actually used for good instead of ending up in the pockets of crooked politics and warlords? I think that's a problem.
    • Sony unveils its first fight stick 'Project Defiant', supports PC and PS5 by Pulasthi Ariyasinghe In a surprise twist, Sony announced a new piece of hardware at its State of Play presentation today. Currently going by the codename Project Defiant, it is Sony's first attempt at making a fight stick. Considering the company is currently partnered with Marvel to make a first-party fighting game featuring heroes and villains from the popular comic universe, this seems to be the right time to unveil the project. As seen in the teaser trailer above, the wireless fight stick follows the modern black and white PlayStation hardware style of the consoles and standard gamepad controllers. The controller will ship with a toolless design for changing the restrictor gates, with square, circle, and octagon options incoming for the stick. Meanwhile, the buttons are confirmed to have mechanical switches. Plus, a dedicated touchpad, much like on the DualSense controller, is available on the top of the fight stick. "It’s built in a sturdy, ergonomic design for a comfortable feel during intense fight sessions," adds the company. Sony is leveraging its PlayStation Link technology in the device. With it, the company is promising ultra-low latency wireless connectivity, making sure it provides players "precise in-game response to each button press and digital stick movement." Interestingly, PlayStation Link is Sony's proprietary wireless connectivity standard designed for PlayStation 5's audio transmissions, which is now being used a little differently for this piece of hardware. The controller has built-in storage for holding both the restrictor gates and the PS Link USB adapter. As expected, a wired connection is also possible, with a USB-C port available on the device for connecting to a PlayStation 5 or PC. To make sure the device remains in good condition during travel, Sony is throwing in a sturdy sling carry case with each Project Defiant fight stick. More details, like the official name, internal hardware, release date, and most importantly, price, will be revealed later. The hardware has a 2026 launch window right now.
  • Recent Achievements

    • First Post
      James courage Tabla earned a badge
      First Post
    • Reacting Well
      James courage Tabla earned a badge
      Reacting Well
    • Apprentice
      DarkShrunken went up a rank
      Apprentice
    • Dedicated
      CHUNWEI earned a badge
      Dedicated
    • Collaborator
      DarkShrunken earned a badge
      Collaborator
  • Popular Contributors

    1. 1
      +primortal
      351
    2. 2
      snowy owl
      167
    3. 3
      +FloatingFatMan
      164
    4. 4
      ATLien_0
      162
    5. 5
      Xenon
      128
  • Tell a friend

    Love Neowin? Tell a friend!