windowsexplorercustom-url-protocol

CustomURLProtocol in browser: how to call windows explorer with unc path


I registered a CustomURLProtocol fileexplorer in my registry. Its calling cmd /c set url=\"%1\" & call set url=%%url:fileexplorer:=%% & call start explorer file:%%url%%.

Calling local folders works well. c:\mydata opens in the fileexplorer with the URL fileexplorer:c:%5Cmydata.
But how do I open an UNC-address like \\myserver\mypath?
Running call explorer file:\\myserver\mypath from the cmd prompt works fine. A URL fileexplorer:%5C%5Cmyserver%5Cmypath fails (opening the explorer as if no path were given).


Solution

  • After a lot of trial & error I found this command: cmd /c set url="%1" & call set url=%%url:fileexplorerunc:=file:%% & call start explorer %%url%% The URL should be fileexplorerunc://myserver/mypath and it also works with local paths with fileexplorerunc://c:/mypath. This, of course, only works with windows OS.