Install Fonts to Workstations

From Wiki

Revision as of 16:34, 23 June 2008 by SYNACK (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to:navigation, search

Creator: Guest

Script Language: VBS

Forum topic Link: http://www.edugeek.net/forums/scripts/4756-script-install-fonts-workstations.html


Create a Folder to house all your additional fonts on a network share e.g. \\%SERVERNAME%\%SHARE%\FONTS

Copy the new font to that share e.g. Twiggy-Bold.ttf

Install the new font onto a workstation.

Using regedit browse to the following Key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

Make a note of the new fonts registry information.

Add this new information to the VB script

Create a new GPO and add the script to run at computer start up

Assign to computers

The font will be available after a restart of the PC with no need for an admin logon.

To update the script quickly I just created a shortcut to the policy folder and then just copy the updated VB script when I have added new fonts.

And here's the code

<vb>' ****************************************************************************

' Copy Fonts From Network Share To C:\WINDOWS\FONTS Folder Of Workstation

' ****************************************************************************

Set WshShell = CreateObject("WScript.Shell")

WshShell.Run "xcopy.exe ""\\%SERVERNAME%\%SHARE \FONTS"" ""C:\windows\fonts"" /C /I /S /E /H /Y /Q", 1,True


' ****************************************************************************

' Imports The Registry Information For The New Fonts - Add A New Line For Each New Font

' Example : WshShell. RegWrite"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\%FONT REG KEY%", "%FONT REG KEY ENTRY%", "REG_SZ"

' ****************************************************************************

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell. RegWrite"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\Twiggy-Bold (TrueType)", "Twiggy-Bold.ttf", "REG_SZ"

WshShell. RegWrite"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\Twiggy-Light (TrueType)", "Twiggy-Light.ttf", "REG_SZ" </vb>