Windows – Open URL with Windows Explorer

browserwindowswindows-explorer

I noticed that if I type a URL into Windows Explorer, it will open the URL in
default browser. I tried this on command line as well:

explorer.exe https://superuser.com

but I noticed that the command line version launches a new explorer.exe
process. When using Windows Explorer GUI, the action is performed with the
original explorer.exe process.

Is it possible to open URL from command line with explorer.exe using the
existing process? I would prefer this as it seems the additional explorer.exe
processes remain even after closing the browser.

Best Answer

Here some workaround for URLs:

rundll32 url,OpenURL https://superuser.com
rundll32 url,FileProtocolHandler https://superuser.com

and for local files:

rundll32 url,OpenURL C:\superuser.txt
rundll32 url,FileProtocolHandler C:\superuser.txt
rundll32 shell32,ShellExec_RunDLL C:\superuser.txt

https://github.com/LOLBAS-Project/LOLBAS/blob/master/Archive-Old-Version/OSLibraries/Url.dll.md

Related Question