英文:
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).
英文:
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).
答案1
得分: 0
这是翻译好的部分:
在经过许多尝试和错误之后,我找到了这个命令:
cmd /c set url="%1" & call set url=%%url:fileexplorerunc:=file:%% & call start explorer %%url%%
URL 应该是 fileexplorerunc://myserver/mypath
,它也适用于本地路径 fileexplorerunc://c:/mypath
。当然,这仅适用于 Windows 操作系统。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论