Using VBS to Install Fonts

The following VBS script can be used to install fonts on a computer remotely. It checks to see if the font already exists, and then installs it if it isn't on the computer.


Set wshShell = CreateObject("WScript.Shell")
Set objFSO = createobject("Scripting.Filesystemobject")
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("\\fileserver\sourcepath")

If objFSO.FileExists(wshShell.SpecialFolders("Fonts") & "\font1.TTF") = False Then
Set objFolderItem = objFolder.ParseName("font1.TTF")
objFolderItem.InvokeVerb("Install")

End If
If objFSO.FileExists(wshShell.SpecialFolders("Fonts") & "\font2.TTF") = False Then
Set objFolderItem = objFolder.ParseName("font2.TTF")
objFolderItem.InvokeVerb("Install")
End If


Share on Google Plus

About Tom DeMeulenaere

Highly accomplished information technology professional with extensive knowledge in System Center Configuration Manager, Windows Server, SharePoint, and Office 365.
    Blogger Comment

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.