@echo off
mode con cols=50 lines=30
color F0
title 恢复win7照片查看器
Rd "%WinDir%\system32\test_permissions" >NUL 2>NUL
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo 请求获取管理员身份运行(请按回车键) &&Pause >nul&&echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B)
Rd "%WinDir%\System32\test_permissions" 2>NUL
echo 添加.jpg格式
reg add "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v ".jpg" /t REG_SZ /d PhotoViewer.FileAssoc.Tiff /f
echo 添加.jpeg格式
reg add "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v ".jpeg" /t REG_SZ /d PhotoViewer.FileAssoc.Tiff /f
echo 添加.png格式
reg add "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v ".png" /t REG_SZ /d PhotoViewer.FileAssoc.Tiff /f
echo 添加.gif格式
reg add "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v ".gif" /t REG_SZ /d PhotoViewer.FileAssoc.Tiff /f
echo 添加.tif格式
reg add "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v ".tif" /t REG_SZ /d PhotoViewer.FileAssoc.Tiff /f
echo 添加.bmp格式
reg add "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v ".bmp" /t REG_SZ /d PhotoViewer.FileAssoc.Tiff /f
echo 添加.ico格式
reg add "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v ".ico" /t REG_SZ /d PhotoViewer.FileAssoc.Tiff /f
echo 请在设置-^>应用-^>默认应用中将图片查看器的默认应用修改为Windows照片查看器
pause
:abcd
cls
echo 如果您还要继续添加图片格式,请在下方输入(如 .jpg)(请确保后缀名正确)。没有则关闭窗口。
set /p b=
set a=reg add "HKLM\SOFTWARE\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations" /v "
set c=" /t REG_SZ /d PhotoViewer.FileAssoc.Tiff /f
set d=%a%%b%%c%
set e=添加
set f=格式
set g=%e%%b%%f%
echo %g%
%d%
echo 请在设置-^>应用-^>默认应用中将图片查看器的默认应用修改为Windows照片查看器
pause
goto abcd