How can I install a font from the command line/batch file?
Learn how to install a font from the command line/batch file.
March 4, 1999
![How can I install a font from the command line/batch file? How can I install a font from the command line/batch file?](https://eu-images.contentstack.com/v3/assets/blt07f68461ccd75245/blt36eb9bbb256646d5/662772230d298b4d6cb2e722/active-directory-object-names595x335_0_4.jpg?width=1280&auto=webp&quality=95&format=jpg&disable=upscale)
A. When you install a font all it does is copy the .ttf file to the %systemroot%fonts and add an entry in HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionFonts. This can be automated with a batch file as follows
Rem fontinst.batcopy akbar.ttf %systemroot%fontsregedit /s font.reg
The font.reg would contain the following:
REGEDIT4
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionFonts]"Akbar Plain (TrueType)"="akbar.ttf"
In this example it copies akbar.ttf which is called "Akbar Plain (TrueType)" (yes its the Simpsons font ;-) ). The reg scipt actually creates a value called "Akbar Plain (TrueType)" under HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionFonts with its contents "akbar.ttf". The new font would be visable once the machine has been rebooted.
If you have some older 16bit applications you may want to add the font to win.ini as well in the [fonts] section. This could be accomplished using a .inf file, e.g.
[UpdateInis]"E:WINNTWIN.INI","Fonts",,"Akbar Plain (TrueType)=akbar.ttf"
See also, "Can I install a font from a cmd prompt or a batch file?" and "Q: How can I cause the ADD Fonts wizard to only display fonts with file name extension .FON and.FO_?"
About the Author
You May Also Like