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

    • Would be good to see Google also being forced to do the same. No promotion of Chrome on Google search. Stop installing into the app data of a locked down machine, etc
    • FileZilla 3.70.6 by Razvan Serea FileZilla is powerful Open Source FTP/SFTP client with many features. It includes a site manager to store all your connection details and logins as well as an Explorer style interface that shows the local and remote folders and can be customized independently. The program offers support for firewalls and proxy connections as well as SSL and Kerberos GSS security. Additional features include keep alive, auto ascii/binary transfer, download queue, manual transfers, raw FTP commands and more. FileZilla key features: Cross-platform support – Available for Windows, macOS, and Linux. FTP, FTPS, and SFTP support – Handles standard and secure file transfer protocols. Tabbed user interface – Easily manage multiple connections at once. Site Manager – Save and organize server connection details. Drag & drop support – Quickly transfer files by dragging them. Filename filtering – Include or exclude specific files using filters. Directory comparison – Compare local and remote directories. Synchronized browsing – Navigate in sync between local and remote folders. Transfer queue – View, manage, and prioritize file transfers. Speed limits – Control upload/download speed to manage bandwidth usage. Keep-alive system – Prevents timeouts during long transfers. Remote file editing – Open and edit remote files using local editors. IPv6 support – Compatible with modern networking standards. FileZilla 3.70.6 changelog: New features SFTP: Added compatibility flag to Site Manager to ignore invalid bits in file attributes flags received from non-compliant servers Bugfixes and minor changes SFTP: Updated to fzssh 1.3.0 Updated to libfilezilla 0.56.1 Removed autodetection of FTP server type governing the remote path syntax. Exotic server types now need to be set explicitly on the advanced page in the Site Manager Download page: FileZilla 3.70.6 | ~10.0 MB (Free, paid upgrade available) Links: FileZilla Home page | Documentation | FileZilla Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Browser vendors pen open letter to Microsoft saying "enough is enough" by Usama Jawad We have seen Microsoft resort to questionable tactics in the past to get more customers to use Edge, such as "bribing" people to use Edge, testing new behavior so that Edge loads automatically on startup every time, and pressuring OEMs to exclusively bundle Edge in Windows PCs. However, the company often receives pushback not only from customers but also from the Browser Choice Alliance (BCA). Now, the collective has penned an open letter to the Redmond tech firm to highlight its dissatisfaction with its practices. For those unaware, BCA is a coalition that touts several browser vendors as its members, including Google Chrome, Midori, Opera, Vivaldi, BrowserWorks, and Wavebox. Its latest open letter to Microsoft CEO Satya Nadella emphasizes that "enough is enough" and that user choice on Windows should be respected. It claimed that the company is abusing its dominant position in the PC space to push customers to its first-party browser, even if they don't want to use it. To do this, it resorts to shady tactics, some of which we highlighted at the start of this piece. It says that Microsoft is making it very difficult for users to set their preferred browser across all touchpoints. This is problematic as PCs are becoming even more prevalent in the AI era, so user choice is being restricted across even more devices, further frustrating users (and competing browser vendors). As such, BCA has urged Microsoft to take the following actions to level the playing field: Allow browser suppliers to compete for preinstallation and default deals with Windows PC manufacturers End dark patterns targeted at users seeking to download and effectively use other browsers (including as system-level default) Bring back the ability for users to make switching default browsers simple and transparent with a “single click” change for all relevant file types and apps (including PDFs) Open all web links in the users’ selected system-level browser of choice Eliminate manipulative Microsoft-exclusive banners pushing Edge in Windows, including when users are searching for other browsers Stop using operating system updates to push users back to Edge Remove the restrictive configurations of existing S mode devices that block the usage of third-party browsers. It believes that all browsers should compete on merit, as this will drive innovation and healthy competition. Despite its strong wording and publication of the letter openly, it's unclear if Microsoft will pay any heed to the BCA and if this will result in any tangible downstream benefits. We'll likely find out in due time.
    • Boo! I was excited for this... Stargate SG-1 Star Michael Shanks Rallies Fans After Amazon Axes Revival, Says 'Now Is the Time to Say Something'
  • 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
      474
    2. 2
      PsYcHoKiLLa
      247
    3. 3
      Skyfrog
      79
    4. 4
      FloatingFatMan
      77
    5. 5
      Michael Scrip
      60
  • Tell a friend

    Love Neowin? Tell a friend!