Share This Post

Installing Fonts During OSD

Font_Book_IconHere’s a simple little script to install fonts during OSD. Note that this is an example of not doing any manual work during OSD: manual work is un-IT. A quick web search, using Bing of course (Hey, Scripting Guy! How Can I Install Fonts Using a Script- – Hey), and a little scripting knowledge resulted in this VBScript.

Const FONTS = &H14&

Set shell = CreateObject(“Shell.Application”)
Set fso = CreateObject(“Scripting.FileSystemObject”)
Set fontsFolder = shell.Namespace(FONTS)

scriptFullName = WScript.ScriptFullName

Set currentFolder = fso.GetFolder (fso.GetParentFolderName(scriptFullName) & “\Fonts”)

For Each file In currentFolder.Files
If fso.GetExtensionName(file.Name) = “ttf” Then
WScript.Echo “Installing font: ” & file.Path
fontsFolder.CopyHere file.Path
End If
Next

Dump this is a .vbs file in a ConfigMgr package with a Fonts subfolder containing any fonts that you want to import then simply use a command-line task to call the VBScript; e.g., cscript InstallFonts.vbs.

One possible improvement for this script is to check for the existence of the Font before trying to import it because if it is already imported, a message box will be displayed with an error message which is obviously not a good thing during OSD (note that the message box is actually visible and clickable though so it’s not a show stopper).

Share This Post

Technology has been my life for over 15 years; for work and play, at the office and at home. My experiences run the gamut: programming, networking, system administration, Windows, Linux, Oracle. I am currently employed by Microsoft ISV partner and have held various other IT positions. I am a contributing author the book System Center Configuration Manager Unleashed 2007, am an active Microsoft MVP in ConfigMgr, and have spoken at both MMS and TechEd North America multiple times.

Leave a Reply