@echo off
pushd "%~dp0"
::setlocal enabledelayedexpansion
set "exe=FSViewer.exe"
set "pid=FSViewer"
rem 图片格式关联
for %%i in (raw,crw,cr2,raf,dcr,mrw,nef,orf,pef,srf,x3f,iff,sgi,xbm,xpm,emf,pcx,tga,png,bmp,jpg,jpeg,gif,ico,psd,tif,tiff,ais,ani,cur,emf,eps,lwf,webp,wmf,heic) do SFTA.exe --reg "%~dp0%exe%" ".%%i" "%pid%"
rem 图片右键菜单
for %%i in (raw,crw,cr2,raf,dcr,mrw,nef,orf,pef,srf,x3f,iff,sgi,xbm,xpm,emf,pcx,tga,png,bmp,jpg,jpeg,gif,ico,psd,tif,tiff,ais,ani,cur,emf,eps,lwf,webp,wmf,heic
) do (
reg add "HKCU\SOFTWARE\Classes\SystemFileAssociations\.%%i\Shell\使用FastStone浏览\command" /f /ve /t REG_SZ /d "%~dp0FSViewer.exe %%1"
)
for %%i in (raw,crw,cr2,raf,dcr,mrw,nef,orf,pef,srf,x3f,iff,sgi,xbm,xpm,emf,pcx,tga,png,bmp,jpg,jpeg,gif,ico,psd,tif,tiff,ais,ani,cur,emf,eps,lwf,webp,wmf,heic
) do (
reg add "HKCU\SOFTWARE\Classes\SystemFileAssociations\.%%i\Shell\使用FastStone浏览" /f /v "Icon" /t REG_SZ /d "%~dp0\FSViewer.exe,0"
)
cls&echo.&echo FastStone Image Viewer 格式关联成功! &timeout /t 2 >nul |