9.13 Win10如何恢复传统"Windows 照片查看器"
https://scz.617.cn/windows/201507302150.txt
Q:
Win10默认的"照片"与Win7上传统"Windows 照片查看器"不是一个东西。搓动鼠标滚 轮时,前者动作是"上一张"或"下一张",后者动作是缩放。放大图片后,前者无法进 行"上一张"或"下一张"的操作,鼠标滚轮无效,也不出现左、右箭头。放大图片后, 后者仍可通过左、右箭头进行"上一张"或"下一张"操作。
从个人习惯上讲,希望在Win10中继续使用传统"Windows 照片查看器",如何做?
A: Flitskikker 2015-07-31
How to bring back Photo Viewer in Windows 10 https://superuser.com/questions/947672/how-to-bring-back-photo-viewer-in-windows-10
检查注册表,确保如下位置有正确内容:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll]
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell]
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open] "MuiVerb"=hex(2):40,00,22,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,\ 46,00,69,00,6c,00,65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,\ 00,73,00,20,00,50,00,68,00,6f,00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,\ 65,00,72,00,5c,00,70,00,68,00,6f,00,74,00,6f,00,76,00,69,00,65,00,77,00,65,\ 00,72,00,2e,00,64,00,6c,00,6c,00,22,00,2c,00,2d,00,33,00,30,00,34,00,33,00,\ 00,00
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command] @=hex(2):22,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\ 00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,\ 75,00,6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,22,00,20,\ 00,22,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,\ 65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,50,\ 00,68,00,6f,00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,72,00,5c,00,\ 50,00,68,00,6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,65,00,72,00,2e,00,64,\ 00,6c,00,6c,00,22,00,2c,00,20,00,49,00,6d,00,61,00,67,00,65,00,56,00,69,00,\ 65,00,77,00,5f,00,46,00,75,00,6c,00,6c,00,73,00,63,00,72,00,65,00,65,00,6e,\ 00,20,00,22,00,25,00,31,00,22,00,00,00
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget] "Clsid"="{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print] "NeverDefault"=""
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\command] @=hex(2):22,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\ 00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,\ 75,00,6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,22,00,20,\ 00,22,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,\ 65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,50,\ 00,68,00,6f,00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,72,00,5c,00,\ 50,00,68,00,6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,65,00,72,00,2e,00,64,\ 00,6c,00,6c,00,22,00,2c,00,20,00,49,00,6d,00,61,00,67,00,65,00,56,00,69,00,\ 65,00,77,00,5f,00,46,00,75,00,6c,00,6c,00,73,00,63,00,72,00,65,00,65,00,6e,\ 00,20,00,22,00,25,00,31,00,22,00,00,00
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\print\DropTarget] "Clsid"="{60fd46de-f830-4894-a628-6fa81bc0190d}"
若想双击导入RecoverWindowsPhotoViewer.reg,确保.reg文件是"UTF-16 LE"格式, 否则导入时报错。
reg.exe query "HKCR\Applications\photoviewer.dll\shell\open" /v "MuiVerb"
MuiVerb REG_EXPAND_SZ @"%ProgramFiles%\Windows Photo Viewer\photoviewer.dll",-3043
reg.exe query "HKCR\Applications\photoviewer.dll\shell\open\command"
(默认) REG_EXPAND_SZ "%SystemRoot%\System32\rundll32.exe" "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen "%1"
reg.exe query "HKCR\Applications\photoviewer.dll\shell\open\DropTarget" /v "Clsid"
Clsid REG_SZ {FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}
reg.exe query "HKCR\Applications\photoviewer.dll\shell\print" /v "NeverDefault"
NeverDefault REG_SZ
reg.exe query "HKCR\Applications\photoviewer.dll\shell\print\command"
(默认) REG_EXPAND_SZ "%SystemRoot%\System32\rundll32.exe" "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen "%1"
reg.exe query "HKCR\Applications\photoviewer.dll\shell\print\DropTarget" /v "Clsid"
Clsid REG_SZ {60fd46de-f830-4894-a628-6fa81bc0190d}
检查文件系统,确保相关文件就位:
$ dir "%SystemRoot%\System32\rundll32.exe" "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll"
选中.jpg文件 右键菜单 打开方式 选择其他应用 更多应用 Windows 照片查看器 始终使用此应用打开.jpg文件
之后双击.jpg文件,将用传统"Windows 照片查看器"打开。
这个方案比较复杂,不推荐。
A: scz 2021-06-23
可以用reg.exe进行命令行操作:
reg.exe add "HKCR\Applications\photoviewer.dll\shell\open" /v "MuiVerb" /t REG_EXPAND_SZ /d "@\"^%ProgramFiles^%\Windows Photo Viewer\photoviewer.dll\",-3043" /f reg.exe add "HKCR\Applications\photoviewer.dll\shell\open\command" /t REG_EXPAND_SZ /d "\"^%SystemRoot^%\System32\rundll32.exe\" \"^%ProgramFiles^%\Windows Photo Viewer\PhotoViewer.dll\", ImageView_Fullscreen \"%1\"" /f reg.exe add "HKCR\Applications\photoviewer.dll\shell\open\DropTarget" /v "Clsid" /t REG_SZ /d "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" /f
reg.exe add "HKCR\Applications\photoviewer.dll\shell\print" /v "NeverDefault" /t REG_SZ /d "" /f reg.exe add "HKCR\Applications\photoviewer.dll\shell\print\command" /t REG_EXPAND_SZ /d "\"^%SystemRoot^%\System32\rundll32.exe\" \"^%ProgramFiles^%\Windows Photo Viewer\PhotoViewer.dll\", ImageView_Fullscreen \"%1\"" /f reg.exe add "HKCR\Applications\photoviewer.dll\shell\print\DropTarget" /v "Clsid" /t REG_SZ /d "{60fd46de-f830-4894-a628-6fa81bc0190d}" /f
对于/d指定的内容,有些注意事项
a) 若字符串中包含空格,整个字符串必须用双引号包起来 b) 对于%some%,若不希望进行环境变量展开,应该写成^%some^%,用^对%转义 c) 若字符串中包含双引号,应该用\对"转义,"some"写成\"some\"
下面这些写法都是处理.reg中的"@=..."
reg.exe query "..." /v "" reg.exe query "..."
reg.exe add "..." /v "" /t REG_EXPAND_SZ /d "..." /f reg.exe add "..." /t REG_EXPAND_SZ /d "..." /f
A: user362515 2011-10-19
How to run Photoviewer.dll in command line https://stackoverflow.com/questions/6190271/how-to-run-photoviewer-dll-in-command-line
在cmd中直接启动传统"Windows 照片查看器"
"%SystemRoot%\System32\rundll32.exe" "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen
此处有大坑
a)
b)
"explorer
c) 若含有空格,保持原样指定绝对路径,不要使用双引号,可以打开
A: adrift21 2015-07-30
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\jpegfile\shell\open] "MuiVerb"=hex(2):40,00,22,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,\ 46,00,69,00,6c,00,65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,\ 00,73,00,20,00,50,00,68,00,6f,00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,\ 65,00,72,00,5c,00,70,00,68,00,6f,00,74,00,6f,00,76,00,69,00,65,00,77,00,65,\ 00,72,00,2e,00,64,00,6c,00,6c,00,22,00,2c,00,2d,00,33,00,30,00,34,00,33,00,\ 00,00
[HKEY_CLASSES_ROOT\jpegfile\shell\open\command] @=hex(2):22,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,\ 00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,72,00,\ 75,00,6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,00,22,00,20,\ 00,22,00,25,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,46,00,69,00,6c,00,\ 65,00,73,00,25,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,73,00,20,00,50,\ 00,68,00,6f,00,74,00,6f,00,20,00,56,00,69,00,65,00,77,00,65,00,72,00,5c,00,\ 50,00,68,00,6f,00,74,00,6f,00,56,00,69,00,65,00,77,00,65,00,72,00,2e,00,64,\ 00,6c,00,6c,00,22,00,2c,00,20,00,49,00,6d,00,61,00,67,00,65,00,56,00,69,00,\ 65,00,77,00,5f,00,46,00,75,00,6c,00,6c,00,73,00,63,00,72,00,65,00,65,00,6e,\ 00,20,00,25,00,31,00,00,00
reg.exe query "HKCR\jpegfile\shell\open" /v "MuiVerb"
MuiVerb REG_EXPAND_SZ @"%ProgramFiles%\Windows Photo Viewer\photoviewer.dll",-3043
reg.exe query "HKCR\jpegfile\shell\open\command" /v ""
(默认) REG_EXPAND_SZ "%SystemRoot%\System32\rundll32.exe" "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1
大坑,%1两侧没有双引号。
reg.exe add "HKCR\jpegfile\shell\open" /v "MuiVerb" /t REG_EXPAND_SZ /d "@\"^%ProgramFiles^%\Windows Photo Viewer\photoviewer.dll\",-3043" /f reg.exe add "HKCR\jpegfile\shell\open\command" /v "" /t REG_EXPAND_SZ /d "\"^%SystemRoot^%\System32\rundll32.exe\" \"^%ProgramFiles^%\Windows Photo Viewer\PhotoViewer.dll\", ImageView_Fullscreen %1" /f
注册表这个位置对应assoc、ftype命令
$ assoc .jpg .jpg=jpegfile
$ ftype jpegfile jpegfile="%SystemRoot%\System32\rundll32.exe" "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1
一般可以用"ftype jpegfile=..."直接设置.jpg打开方式。但要想精确设成上面这行 内容,未能成功。^%some^%的写法进入注册表后保持了原样,^号被保留下来。若不 使用^号,%some%被展开。
若不在乎%some%环境变量展开,用"ftype jpegfile=..."比较直观。
奇异的是,成功之后删除相关子键,"Windows 照片查看器"也被放出来了,仍然有效。
reg.exe delete "HKCR\jpegfile\shell\open" /f reg.exe query "HKCR\jpegfile\shell\open" reg.exe query "HKCR\jpegfile\shell\open\command"
错误: 系统找不到指定的注册表项或值。
A: limits 2015-08-20
有个更野、更简单的办法
reg.exe query "HKCU\SOFTWARE\Classes.jpg" /v ""
(默认) REG_SZ (数值未设置)
reg.exe add "HKCU\SOFTWARE\Classes.jpg" /v "" /t REG_SZ /d "PhotoViewer.FileAssoc.Tiff" /f
未细究其原理,这样干之后,双击打开.jpg时启动传统"Windows 照片查看器"。可以 照此处理.gif、.png、.bmp、.tiff、.ico等扩展名。
推荐这个方案。
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Classes.jpg] @="PhotoViewer.FileAssoc.Tiff"
[HKEY_CURRENT_USER\SOFTWARE\Classes.gif] @="PhotoViewer.FileAssoc.Tiff"
[HKEY_CURRENT_USER\SOFTWARE\Classes.png] @="PhotoViewer.FileAssoc.Tiff"
[HKEY_CURRENT_USER\SOFTWARE\Classes.bmp] @="PhotoViewer.FileAssoc.Tiff"
[HKEY_CURRENT_USER\SOFTWARE\Classes.tiff] @="PhotoViewer.FileAssoc.Tiff"
[HKEY_CURRENT_USER\SOFTWARE\Classes.ico] @="PhotoViewer.FileAssoc.Tiff"
奇异的是,成功之后删除相关子键,"Windows 照片查看器"也被放出来了,仍然有效。
reg.exe delete "HKCU\SOFTWARE\Classes.jpg" /f reg.exe query "HKCU\SOFTWARE\Classes.jpg"
错误: 系统找不到指定的注册表项或值。
另有一种类似的方案:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Photo Viewer]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities] "ApplicationDescription"="@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-3069" "ApplicationName"="@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-3009"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations] ".tif"="PhotoViewer.FileAssoc.Tiff" ".tiff"="PhotoViewer.FileAssoc.Tiff" ".jpg"="PhotoViewer.FileAssoc.Tiff"
reg.exe add "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v ".jpg" /t REG_SZ /d "PhotoViewer.FileAssoc.Tiff" /f
reg.exe query "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations"
.tif REG_SZ PhotoViewer.FileAssoc.Tiff
.tiff REG_SZ PhotoViewer.FileAssoc.Tiff
.jpg REG_SZ PhotoViewer.FileAssoc.Tiff
reg.exe delete "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v ".jpg" /f
D: scz 2021-06-24
前面多次提到,成功之后删除相关子键,"Windows 照片查看器"也被放出来了。可能 与这个位置相关:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\OpenWithList] "a"="Microsoft.Windows.Photos_8wekyb3d8bbwe!App" "MRUList"="abecfd" "b"="mspaint.exe" ... "e"="Microsoft.MSPaint_8wekyb3d8bbwe!Microsoft.MSPaint" ...
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\OpenWithProgids] "jpegfile"=hex(0):
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\UserChoice] "ProgId"="Applications\photoviewer.dll" "Hash"="7OOz/D3wIo4="
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\OpenWithProgids] "jpegfile"=hex(0):
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\UserChoice] "Hash"="0L44vl4Awfc=" "ProgId"="jpegfile"
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\OpenWithList] ... "MRUList"="cdfbea" ... "c"="mspaint.exe" ... "g"="PhotoViewer.dll"
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\OpenWithProgids] "jpegfile"=hex(0): "PhotoViewer.FileAssoc.Tiff"=hex(0):
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\UserChoice] "Hash"="P2ThrzmnlhY=" "ProgId"="PhotoViewer.FileAssoc.Tiff"
"Windows 照片查看器"被设成默认应用时,UserChoice子键随之变化,不同的技术方 案有不同的变化,上面列举了其中三种情况。
reg.exe query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\UserChoice"
reg.exe query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\UserChoice" /v "Hash"
Hash REG_SZ 3nJl5WEmW0E=
即使ProgId相同,这个Hash值也会变
reg.exe query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\UserChoice" /v "ProgId"
ProgId REG_SZ PBrush
这是"画图"
reg.exe delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\UserChoice" /f reg.exe delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\UserChoice" /v "Hash" /f reg.exe delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\UserChoice" /v "ProgId" /f reg.exe add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts.jpg\UserChoice" /v "ProgId" /t REG_SZ /d "PBrush" /f
错误: 拒绝访问。
即使是管理员权限,也无法在regedit中正常修改"UserChoice\ProgId",会报错。但 在regedit中可以删除整个UserChoice子键,reg.exe删UserChoice子键失败,诡异。 这里存在权限检查不一致的情况,可能是API层面的。
这事的水真深,奇技淫巧太多。
D: lyx zyh 2021-06-24
UserChoice子键有个"Set Value"权限,对当前用户设成"拒绝",所以无法修改该子 键下的内容。"reg.exe delete UserChoice"失败,是因为RegOpenKey时试图拥有 "All Access",尝试打开子键时就失败了。regedit删除UserChoice子键时,打开阶 段申请的是Delete权限。