9
edits
Changes
Fonts
,→Example using a VBscript
objFolder.CopyHere MyDir &"\MyNewFont.ttf"
</source>
Or, to install all .ttf files from the folder containing your FontInstall.vbs script:
<source lang="vb">
Const FONTS = &H14&
Set objShell = CreateObject("Shell.Application")
Set ofso = CreateObject("Scripting.FileSystemObject")
SourceFolder = ofso.GetParentFolderName(Wscript.ScriptFullName)
Set oSource = objShell.Namespace(SourceFolder)
Set oWinFonts = objShell.Namespace(FONTS)
' 4 f*ing lines instead of just "if (/\.ttf$/i)". I hate VBscript!!!
Set rxTTF = New RegExp
rxTTF.IgnoreCase = True
rxTTF.Pattern = "\.ttf$"
FOR EACH FontFile IN oSource.Items()
' FontFile may be without .ttf extension! Use FontFile.Path
IF rxTTF.Test(FontFile.Path) THEN
oWinFonts.CopyHere FontFile.Path
END IF
NEXT
</source>