w10install/scripts/set-filetypes.cmd
2023-01-20 17:11:22 +01:00

70 lines
1.7 KiB
Batchfile

@echo off
echo ####### %0 #######
set AKA=irfanview
set BINARY="%PROGRAMFILES%\IrfanView\i_view64.exe"
set SUFFIX=acr ani b3d bmp dib clp crw cr2 cr3 cur dcm ima dcx dds djvu iw44 dxf ^
ecw emf eps ps exr g3 gif hdp jxr wdp heic ico iff lbm jls jp2 jpc j2k ^
jpg jpeg jpe jpm mng jng pbm pcd pcx pgm png ppm psd psp ras sun raw rle ^
sff sgi rgb sid tga tif tiff wbmp webp wmf xbm xpm swf flv ttf asf avi ^
mpg mpe mpeg mov wmv aif mid rmi mp3 ogg au snd wav wma
call :SFTA
set AKA=PDF24
set BINARY="%PROGRAMFILES%\PDF24\pdf24-Reader.exe"
set SUFFIX=pdf
call :SFTA
set AKA=Presentations
set BINARY="%PROGRAMFILES%\Softmaker Office 2021\Presentations.exe"
set SUFFIX=ppt pptx
call :SFTA
set AKA=PlanMaker
set BINARY="%PROGRAMFILES%\Softmaker Office 2021\Planmaker.exe"
set SUFFIX=xls xlsx
call :SFTA
set AKA=TextMaker
set BINARY="%PROGRAMFILES%\Softmaker Office 2021\Textmaker.exe"
set SUFFIX=doc docx
call :SFTA
rem refresh desktop (W10 style)
ie4uinit.exe -show
goto :END
rem ####################################################
rem set filetypes with tool "sfta" ...
:SFTA
set FILETYPE_DONE="%LOCALAPPDATA%\.filetype_done.%AKA%"
if NOT EXIST %BINARY% (
echo INFO: [ %BINARY% ] is not installed.
goto :eof
) else (
echo working on [ %AKA% ] ...
)
if NOT EXIST %FILETYPE_DONE% (
for %%A in (
%SUFFIX%
) do (
echo registering file type [ .%%A ] for [ %AKA% ]...
sfta --reg %BINARY% .%%A
)
rem create a statusfile ...
echo 1 >%FILETYPE_DONE%
)
goto :eof
rem ####################################################
:END
echo ####### %0 #######