自從發表只要變更設定,就能讓相片顯示器可以看LINE下載的圖片後,心想可不可以[只要點兩下,就能讓Win10擁有相片檢視器且完成後續設定]。不然,經過系列文章1、2之後,點完兩下後,還要做設定。覺得很麻煩,一點都不方便。有沒有更快的方法?
使用步驟教學:
看完資料來源1.[Fix] Error “Windows Photo Viewer can’t display this picture”後,發現底下有一行字關於Registry。其內容如下:
Windows Registry Editor Version 5.00 HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ICM\RegisteredProfiles] "sRGB"="RSWOP.icm"
好奇的我就同時打開Regedit,將HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ICM\RegisteredProfiles貼上
與控制台->色彩管理->進階,進行比對。
比對之後,發現
程式目的:只要點兩下,就能讓Win10擁有相片檢視器且完成後續設定
檔案名稱:PhotoViewerAndColorManagementSetting.BAT
檔案內容:
@echo off
REM ---------------以下是程式碼,不需更改---------------
REM :: BatchGotAdmin (Run as Admin code starts)
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
REM :: BatchGotAdmin (Run as Admin code ends)
REM :: Your codes should start from the following line
REM 設定照片檢視器 PhotoViewerSetting
set regpath=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations
REM ---------------以下是程式碼,不需更改---------------
REM :: BatchGotAdmin (Run as Admin code starts)
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
REM :: BatchGotAdmin (Run as Admin code ends)
REM :: Your codes should start from the following line
REM 設定照片檢視器 PhotoViewerSetting
set regpath=HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Photo Viewer\Capabilities\FileAssociations
@reg add "%regpath%" /v ".jpeg" /d "PhotoViewer.FileAssoc.Tiff" /t REG_SZ /f
@reg add "%regpath%" /v ".jpg" /d "PhotoViewer.FileAssoc.Tiff" /t REG_SZ /f
@reg add "%regpath%" /v ".png" /d "PhotoViewer.FileAssoc.Tiff" /t REG_SZ /f
@reg add "%regpath%" /v ".bmp" /d "PhotoViewer.FileAssoc.Tiff" /t REG_SZ /f
REM 設定顏色管理 ColorManagementSetting
set regpath=HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ICM\RegisteredProfiles
@reg add "%regpath%" /v "sRGB" /d "RSWOP.icm" /t REG_SZ /f
pause
exit
@reg add "%regpath%" /v ".jpg" /d "PhotoViewer.FileAssoc.Tiff" /t REG_SZ /f
@reg add "%regpath%" /v ".png" /d "PhotoViewer.FileAssoc.Tiff" /t REG_SZ /f
@reg add "%regpath%" /v ".bmp" /d "PhotoViewer.FileAssoc.Tiff" /t REG_SZ /f
REM 設定顏色管理 ColorManagementSetting
set regpath=HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ICM\RegisteredProfiles
@reg add "%regpath%" /v "sRGB" /d "RSWOP.icm" /t REG_SZ /f
pause
exit
資料來源:
1.[Fix] Error “Windows Photo Viewer can’t display this picture”
https://www.winhelponline.com/blog/error-windows-photo-viewer-cant-display-this-picture-no-memory/