w10install/scripts/set-filetypes.cmd

140 lines
4.1 KiB
Batchfile
Raw Permalink Normal View History

@echo off
2023-02-15 19:05:06 +01:00
2023-04-18 21:19:19 +02:00
set TOOLS=%SystemDrive%\tools
2023-01-20 21:50:27 +01:00
set ARG1=null
IF "%~1" NEQ "" set ARG1=%1
if /I %ARG1% == /? goto usage
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=SumatraPDF
set BINARY="%TOOLS%\SumatraPDF.exe"
set SUFFIX=pdf epub mobi fb2 fb2z pdb tcr cbz cbr cbt cb7 djv djvu chm xps oxps xod
call :SFTA
set AKA=Presentations
set BINARY="%PROGRAMFILES%\Softmaker Office 2021\Presentations.exe"
2023-12-06 15:59:20 +01:00
if NOT exist %BINARY% set BINARY="%PROGRAMFILES%\Softmaker Office 2024\Presentations.exe"
2024-02-21 15:21:08 +01:00
if NOT exist %BINARY% set BINARY="%PROGRAMFILES(x86)%\Softmaker FreeOffice 2021\Presentations.exe"
2024-09-10 23:26:49 +02:00
set SUFFIX=prdx prsx prvx prd prv
call :SFTA
set AKA=PlanMaker
set BINARY="%PROGRAMFILES%\Softmaker Office 2021\Planmaker.exe"
2023-12-06 15:59:20 +01:00
if NOT exist %BINARY% set BINARY="%PROGRAMFILES%\Softmaker Office 2024\Planmaker.exe"
2024-02-21 15:21:08 +01:00
if NOT exist %BINARY% set BINARY="%PROGRAMFILES(x86)%\Softmaker FreeOffice 2021\Planmaker.exe"
2024-09-10 23:26:49 +02:00
set SUFFIX=pmd pmdx pmv pmvx
call :SFTA
set AKA=TextMaker
set BINARY="%PROGRAMFILES%\Softmaker Office 2021\Textmaker.exe"
2023-12-06 15:59:20 +01:00
if NOT exist %BINARY% set BINARY="%PROGRAMFILES%\Softmaker Office 2024\Textmaker.exe"
2024-02-21 15:21:08 +01:00
if NOT exist %BINARY% set BINARY="%PROGRAMFILES(x86)%\Softmaker FreeOffice 2021\Textmaker.exe"
2024-09-10 23:26:49 +02:00
set SUFFIX=doc docx dot dotx odt
call :SFTA
set AKA=Powerpoint
set BINARY="%PROGRAMFILES%\Microsoft Office\root\Office16\powerpnt.exe"
set SUFFIX=pptx pptm ppt potx potm pot ppsx ppsm pps ppam ppa odp
call :SFTA
set AKA=Excel
set BINARY="%PROGRAMFILES%\Microsoft Office\root\Office16\excel.exe"
set SUFFIX=xls xlsx xlsm xlsb xlt xltx xltm xlam xla ods
call :SFTA
set AKA=Word
set BINARY="%PROGRAMFILES%\Microsoft Office\root\Office16\winword.exe"
set SUFFIX=doc docx docm dot dotx dotm odt rtf
2023-01-20 21:50:27 +01:00
call :SFTA
set AKA=PureBasic
set BINARY="%PROGRAMFILES%\PureBasic\PureBasic.exe"
set SUFFIX=pb pbi pbp pbf
call :SFTA
set AKA=emClient
set BINARY="%PROGRAMFILES(x86)%\eM Client\MailClient.exe"
set SUFFIX=eml
call :SFTA
set AKA=VScode
set BINARY="%PROGRAMFILES%\Microsoft VS Code\Code.exe"
2023-02-13 14:40:27 +01:00
set SUFFIX=c md sh bash py go
2023-01-20 21:50:27 +01:00
call :SFTA
set AKA=VLC
set BINARY="%PROGRAMFILES%\VideoLAN\VLC\vlc.exe"
set SUFFIX=3g2 3gp 3gp2 3gpp amv asf avi bik divx drc dv dvr-ms evo f4v flv gvi gxf m1v m2t m2ts m4v mkv mov ^
mp2 mp2v mp4 mp4v mpe mpeg mpeg1 mpeg2 mpeg4 mpg mpv2 mts mtv mxf mxg nsv nuv ogg ogm ogv ogx ^
rec rm rmvb rpl thp tod tp ts tts txd vob vro webm 3ga 669 a52 aac ac3 adt adts aif aifc aiff amb ^
amr aob ape au awb caf dts flac it kar m4a m4b m4p m5p mid mka mlp mod mpa mp1 mp3 mpc mpga mus oga ^
oma opus qcp ra rmi s3m sid spx tak thd tta voc vqf w64 wav wma wv xa xm asx b4s cue ifo m3u m3u8 ^
pls sdp vlc xspf wvx
call :SFTA
2023-03-09 22:10:49 +01:00
set AKA=Python
set BINARY="%PROGRAMFILES%\Python39\python.exe"
set SUFFIX=py
call :SFTA
rem refresh desktop (W10 style)
ie4uinit.exe -show
2023-01-20 21:50:27 +01:00
echo ####### %0 #######
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% ] ...
)
2023-01-20 21:50:27 +01:00
rem use the FORCE Luke!
if /I %ARG1% == /F (
del /F /Q %FILETYPE_DONE% 2>nul
)
rem do the work HERE!
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 ####################################################
2023-01-20 21:50:27 +01:00
:USAGE
echo.
echo "usage: %0 [/F|/?]"
echo " /F = force "
echo " /? = show help"
echo.
:END