Batch文件用于重新使用Windows照片查看器

huangapple go评论69阅读模式
英文:

Batch file to resort to Windows Photo Viewer

问题

Windows 10.
Microsoft不断删除我设置为Windows照片查看器的默认照片查看器。
是否有批处理文件可以恢复此设置?

英文:

Windows 10.
Microsoft continuously keep removing the default photo viewer which I have set to Windows Photo Viewer.
Is there a batch file that will restore this setting?

答案1

得分: 1

批处理文件修改必要的注册表值,将Windows照片查看器设置为各种图像文件扩展名(例如.bmp.jpg.png)的默认照片查看器。运行批处理文件后,Windows照片查看器应该恢复为这些文件类型的默认照片查看器。

@echo off

REM 将Windows照片查看器恢复为默认照片查看器

REM 为Windows照片查看器设置必要的注册表值
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.Bitmap" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.dib\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.Bitmap" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.gif\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.GIF" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpeg\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.JFIF" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.JFIF" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpe\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.JFIF" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jfif\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.JFIF" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.Png" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.Tiff" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.Tiff" /f

echo Windows照片查看器已恢复为默认照片查看器。

pause
英文:

The batch file modifies the necessary registry values to set Windows Photo Viewer as the default photo viewer for various image file extensions (e.g., .bmp, .jpg, .png). After running the batch file, Windows Photo Viewer should be restored as the default photo viewer for those file types.

@echo off

REM Restoring Windows Photo Viewer as the default photo viewer

REM Set the necessary registry values for Windows Photo Viewer
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bmp\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.Bitmap" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.dib\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.Bitmap" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.gif\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.GIF" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpeg\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.JFIF" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpg\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.JFIF" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jpe\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.JFIF" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.jfif\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.JFIF" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.png\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.Png" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.Tiff" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tiff\UserChoice" /v Progid /d "PhotoViewer.FileAssoc.Tiff" /f

echo Windows Photo Viewer has been restored as the default photo viewer.

pause

huangapple
  • 本文由 发表于 2023年5月28日 20:32:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/76351503.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定