# Script to change Fonts on Windows 10 devices

Modifying the system fonts on Windows 10 is a lot easier with scripts. For those font files installed on the devices already, the administrator can [execute scripts](https://www.hexnode.com/mobile-device-management/help/executing-custom-scripts-for-windows/) from the Hexnode console to change the system font to the specified font family or typeface.

 Disclaimer:The Sample Scripts provided below are adapted from third-party Open-Source sites.

 

Change System Font
------------------

Script to set a specified font on Windows

$string1 = "Windows Registry Editor Version 5.00 \[HKEY\_LOCAL\_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\] `"Segoe UI (TrueType)`"=`"`" `"Segoe UI Bold (TrueType)`"=`"`" `"Segoe UI Bold Italic (TrueType)`"=`"`" `"Segoe UI Italic (TrueType)`"=`"`" `"Segoe UI Light (TrueType)`"=`"`" `"Segoe UI Semibold (TrueType)`"=`"`" `"Segoe UI Symbol (TrueType)`"=`"`" \[HKEY\_LOCAL\_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes\] `"Segoe UI`"=`"$args`" " Add-Content C:\\hexnode\\new\_font.reg $string1 Write-Output $? Start-Process regedit.exe -ArgumentList '/s','C:\\hexnode\\new\_font.reg' -PassThru Remove-Item -Path C:\\hexnode\\new\_font.reg

   1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

  $string1 = "Windows Registry Editor Version 5.00

\[HKEY\_LOCAL\_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\]

`"Segoe UI (TrueType)`"=`"`"

`"Segoe UI Bold (TrueType)`"=`"`"

`"Segoe UI Bold Italic (TrueType)`"=`"`"

`"Segoe UI Italic (TrueType)`"=`"`"

`"Segoe UI Light (TrueType)`"=`"`"

`"Segoe UI Semibold (TrueType)`"=`"`"

`"Segoe UI Symbol (TrueType)`"=`"`"

\[HKEY\_LOCAL\_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes\]

`"Segoe UI`"=`"$args`" "

Add-Content C:\\hexnode\\new\_font.reg $string1

Write-Output $?

Start-Process regedit.exe -ArgumentList '/s','C:\\hexnode\\new\_font.reg' -PassThru

Remove-Item -Path C:\\hexnode\\new\_font.reg

   

 

  

While executing the script from the Hexnode console, you must specify the name of the required font within double quotes in the Arguments field. If the font files are installed already, the changes affect the device following a [restart](https://www.hexnode.com/mobile-device-management/help/restart-a-device-using-hexnode-mdm/) action.
![Execute custom script on Windows device to set a specific font](https://cdn.hexnode.com/mobile-device-management/help/wp-content/uploads/2022/05/set-system-font-on-windows.png "set system font on windows")[](https://cdn.hexnode.com/mobile-device-management/help/wp-content/uploads/2022/05/set-system-font-on-windows.png)

Revert to the default System Font 
----------------------------------

You may use the following script to revert the system to its default font.

Script to revert to default system fonts

$string1 = "Windows Registry Editor Version 5.00 \[HKEY\_LOCAL\_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\] `"Segoe UI (TrueType)`"=`"segoeui.ttf`" `"Segoe UI Black (TrueType)`"=`"seguibl.ttf`" `"Segoe UI Black Italic (TrueType)`"=`"seguibli.ttf`" `"Segoe UI Bold (TrueType)`"=`"segoeuib.ttf`" `"Segoe UI Bold Italic (TrueType)`"=`"segoeuiz.ttf`" `"Segoe UI Emoji (TrueType)`"=`"seguiemj.ttf`" `"Segoe UI Historic (TrueType)`"=`"seguihis.ttf`" `"Segoe UI Italic (TrueType)`"=`"segoeuii.ttf`" `"Segoe UI Light (TrueType)`"=`"segoeuil.ttf`" `"Segoe UI Light Italic (TrueType)`"=`"seguili.ttf`" `"Segoe UI Semibold (TrueType)`"=`"seguisb.ttf`" `"Segoe UI Semibold Italic (TrueType)`"=`"seguisbi.ttf`" `"Segoe UI Semilight (TrueType)`"=`"segoeuisl.ttf`" `"Segoe UI Semilight Italic (TrueType)`"=`"seguisli.ttf`" `"Segoe UI Symbol (TrueType)`"=`"seguisym.ttf`" `"Segoe MDL2 Assets (TrueType)`"=`"segmdl2.ttf`" `"Segoe Print (TrueType)`"=`"segoepr.ttf`" `"Segoe Print Bold (TrueType)`"=`"segoeprb.ttf`" `"Segoe Script (TrueType)`"=`"segoesc.ttf`" `"Segoe Script Bold (TrueType)`"=`"segoescb.ttf`" \[HKEY\_LOCAL\_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes\] `"Segoe UI`"=- " Add-Content C:\\hexnode\\new\_font.reg $string1 Write-Output $? Start-Process regedit.exe -ArgumentList '/s','C:\\hexnode\\new\_font.reg' -PassThru Remove-Item -Path C:\\hexnode\\new\_font.reg

   1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

  $string1 = "Windows Registry Editor Version 5.00

\[HKEY\_LOCAL\_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts\]

`"Segoe UI (TrueType)`"=`"segoeui.ttf`"

`"Segoe UI Black (TrueType)`"=`"seguibl.ttf`"

`"Segoe UI Black Italic (TrueType)`"=`"seguibli.ttf`"

`"Segoe UI Bold (TrueType)`"=`"segoeuib.ttf`"

`"Segoe UI Bold Italic (TrueType)`"=`"segoeuiz.ttf`"

`"Segoe UI Emoji (TrueType)`"=`"seguiemj.ttf`"

`"Segoe UI Historic (TrueType)`"=`"seguihis.ttf`"

`"Segoe UI Italic (TrueType)`"=`"segoeuii.ttf`"

`"Segoe UI Light (TrueType)`"=`"segoeuil.ttf`"

`"Segoe UI Light Italic (TrueType)`"=`"seguili.ttf`"

`"Segoe UI Semibold (TrueType)`"=`"seguisb.ttf`"

`"Segoe UI Semibold Italic (TrueType)`"=`"seguisbi.ttf`"

`"Segoe UI Semilight (TrueType)`"=`"segoeuisl.ttf`"

`"Segoe UI Semilight Italic (TrueType)`"=`"seguisli.ttf`"

`"Segoe UI Symbol (TrueType)`"=`"seguisym.ttf`"

`"Segoe MDL2 Assets (TrueType)`"=`"segmdl2.ttf`"

`"Segoe Print (TrueType)`"=`"segoepr.ttf`"

`"Segoe Print Bold (TrueType)`"=`"segoeprb.ttf`"

`"Segoe Script (TrueType)`"=`"segoesc.ttf`"

`"Segoe Script Bold (TrueType)`"=`"segoescb.ttf`"

\[HKEY\_LOCAL\_MACHINE\\SOFTWARE\\Microsoft\\Windows 

NT\\CurrentVersion\\FontSubstitutes\]

`"Segoe UI`"=- "

Add-Content C:\\hexnode\\new\_font.reg $string1

Write-Output $?

Start-Process regedit.exe -ArgumentList '/s','C:\\hexnode\\new\_font.reg'

-PassThru

Remove-Item -Path C:\\hexnode\\new\_font.reg

   

 

  

Once the script is executed, a device restart is necessary for the changes to take effect.

 Notes:- It is recommended to manually validate the script execution on a system before executing the action in bulk.
- Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.