'=========================
'Syntax: "InstallFont.vbs" /Font:"
'=========================
Option Explicit
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FileExists(WScript.Arguments.Named.Item("Font")) Then
Dim WSH
Set WSH = CreateObject("WScript.Shell")
'Coping the font file into the system folter Fonts
FSO.CopyFile WScript.Arguments.Named.Item("Font"), WSH.SpecialFolders("Fonts") & "\"
'Installaton of the font using API
WSH.Run "RunDll32.exe gdi32.dll,AddFontResourceA " & FSO.GetBaseName(WScript.Arguments.Named.Item("Font"))
End If
Additional *.bat file used for that task resolve:
REM========определение рабочих путей======
set mainpath=\\comp21\WORK\fontsinstall
REM========creating fontpaths.txt======
del %mainpath%\fontpaths.txt
FOR %%B in ("%mainpath%\fonts\"*.FON) do (echo %%B >> "%mainpath%\fontpaths.txt")
echo "fontpaths.txt is created"
REM========removing the fonts======
FOR /F "tokens=1-5 delims=\" %%B in (%mainpath%\fontpaths.txt) do (echo %%F removed & del %windir%\fonts\%%F)
REM========font installation======
FOR %%B in ("%mainpath%\fonts\"*.FON) do (%mainpath%\fontsinstall.vbs /Font:%%B & echo Font %%B is installed)

