rss logo

Deploying 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 things first, we need to have the font file that we want to deploy. For this example, let's assume we want to deploy the "STD-Regular (OpenType)" font.

A windows font file

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

Batch Script

Main commands to understand

  • Check if the STD-Regular (OpenType) font is present to determine if it is already installed:
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" | findstr "STD-Regular (OpenType)"
  • Copy the font file from the Active Directory to the C:\Windows\Fonts directory:
copy \\std.local\SYSVOL\std.local\scripts\STD-Regular.otf C:\Windows\Fonts\
  • Register the font 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 Active Directory save batch script and STD-Regular.otf font to C:\Windows\SYSVOL\sysvol\std.local\scripts\:
Screenshot of Windows Explorer showing the batch and font file

Create Group Policy Object

To automate the font installation process, we will create a Group Policy Object (GPO) that executes the batch script when computers start up.

  • Open Active Directory Users and Computers console:
Run Active Directory Users and Computers
  • Move the computers on which you want to install the font to the Workstations Organizational Unit (OU):
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
  • Navigate 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 click 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