我想假设 URL annotate://\REMOTESERVER1\path o emote ile.pdf 在 Windows 用户的机器上打开默认的 PDF 阅读器,并打开远程文件,而不是在本地下载和打开它。我从命令行知道以下工作:
start \\REMOTESERVER1\path\to\remote\file.pdf
我已使用以下说明将密钥添加到注册表中: https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa767914(v=vs.85)?redirectedfrom=MSDN
我在“命令”值中尝试了以下内容:
注:
Acrobat 似乎没有内置任何东西来捕获自定义 URI 协议。有解决办法吗?
旧线程,但仍然需要答案。
应用程序协议 URI 将整个 URI 作为参数传递,而不仅仅是您希望作为参数的部分。因此,当您形成链接
acrobat:my.pdf
时,作为HKEY_CLASSES_ROOT\acrobat\shell\open\command
进入%1
的不是my.pdf
,而是acrobat:my.pdf
。
替换
Computer\HKEY_CLASSES_ROOT\acrobat\shell\open\command\Default
="C:\program files\adobe\acrobat DC\acrobat\acrobat.exe" "%1"
与
Default
=cmd /v:on /c "SET _invocation=%1 & "C:\program files\adobe\acrobat DC\acrobat\acrobat.exe" !_invocation:acrobat:=!"
是一种绕过它的方法。
编辑:关于这个的几个注释。
这确实适用于 SharePoint 以正确签出文件,使“保存”工作而不是强制执行“另存为”。
以上内容与其他已打开的 Acrobat 窗口/选项卡的播放效果不佳。要解决此问题,请删除
Computer\HKEY_CLASSES_ROOT\acrobat\shell\open\ddeexec
或删除该键和子键的值。
这引发了另一个更新问题,总是恢复
ddeexec
键。虽然 command
键持续更新,但如果使用“将 adobe 设置为默认值”,它会被重置。
所以要解决这一切,只需制定一个新协议“adobe”:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\adobe]
@="URL:PDF Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\adobe\DefaultIcon]
@="C:\\Program Files\\Adobe\\Acrobat DC\\Acrobat\\Acrobat.exe"
[HKEY_CLASSES_ROOT\adobe\shell]
@="Open"
[HKEY_CLASSES_ROOT\adobe\shell\open]
@="Open with Adobe Acrobat"
[HKEY_CLASSES_ROOT\adobe\shell\open\command]
@="cmd /v:on /c \"SET _invocation=%1 & start \"\" \"C:\\program files\\adobe\\acrobat DC\\acrobat\\acrobat.exe\" !_invocation:adobe:=!\""
如果要使用 HTTP 访问文件,Adobe Reader 不能使用 URL 作为参数。所以补充 retrotube 答案,打开命令可以写成:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\adobe]
@="URL:PDF Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\adobe\DefaultIcon]
@="C:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\AcroRd32.exe"
[HKEY_CLASSES_ROOT\adobe\shell]
@="Open"
[HKEY_CLASSES_ROOT\adobe\shell\open]
@="Open with Adobe Acrobat"
[HKEY_CLASSES_ROOT\adobe\shell\open\command]
@="cmd /v:on /c \"SET _invocation=%1 & SET _sfile=!_invocation:~6! & SET _dfile=!temp!\\!random!-!random!-!random!.pdf & curl -o !_dfile! !_sfile! & start \"\" \"C:\\Program Files (x86)\\Adobe\\Acrobat Reader DC\\Reader\\AcroRd32.exe\" !_dfile!"