Windows Registry Editor Version 5.00 HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ICM\RegisteredProfiles] "sRGB"="RSWOP.icm"
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 ".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/