rss logo

How to Deploy Fonts via Group Policy Objects (GPO)

Microsoft logo

I needed to deploy a font in a Microsoft Windows Active Directory environment. Surprisingly, it appears that there is no built-in method to distribute fonts using Group Policy Objects (GPO). To achieve this, I created a batch script that runs at startup when users log on through Group Policy Objects.

Font file

First, we need the font file we want to deploy. For this example, let's assume we want to deploy the "STD-Regular (OpenType)" font.

A windows font file

The aim is to copy the font file into the "C:\Windows\Fonts" directory on each target machine where we want to deploy the font.

Batch Script

Main commands to understand

  • Check the Windows registry for the STD-Regular (OpenType) font to see if it is already installed:
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" | findstr "STD-Regular (OpenType)"
  • Copy the font file from the SYSVOL folder in the Active Directory to the C:\Windows\Fonts directory:
copy \\std.local\SYSVOL\std.local\scripts\STD-Regular.otf C:\Windows\Fonts\
  • Add the font entry to the Windows registry:
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "STD-Regular (OpenType)" /t REG_SZ /d STD-Regular.otf /f

Full batch script

  • Place this script in the C:\Windows\SYSVOL\sysvol\yourdomain.local\scripts\ directory of your Active Directory server:
@echo off reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" | findstr "STD-Regular (OpenType)" IF %ERRORLEVEL% == 0 goto END copy \\std.local\SYSVOL\std.local\scripts\STD-Regular.otf C:\Windows\Fonts\ reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /v "STD-Regular (OpenType)" /t REG_SZ /d STD-Regular.otf /f :END
  • From an Active Directory server, save the batch script and the STD-Regular.otf font in C:\Windows\SYSVOL\sysvol\std.local\scripts\:
Screenshot of Windows Explorer showing the batch and font file

Create a Group Policy Object

To automate the font installation process, we're going to create a Group Policy Object (GPO) so that the batch script can be run when domain computers start up.

  • Open the Active Directory Users and Computers console:
Run Active Directory Users and Computers
  • Move the computers on which you wish to install the font to the Organizational Unit (OU) Workstations:
Run Active Directory Users and Computers
  • Open the Group Policy Manager console:
Run Group Policy Management Console
  • Create the GPO:
Create a GPO
  • Enter a descriptive name for the new GPO:
New GPO name
  • Edit the Group Policy Object (GPO):
Edit a GPO
  • Go to Computer Configuration > Policies > Windows Settings > Scripts (Startup/Shutdown). Right-click on Startup and select Properties:
Screenshot of the Group Policy Management Editor to create a startup script
  • Click on Add… and then on Browse to locate the script file:
Three steps to select the batch script that will be launched at startup

And voila…

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :

contact mail address