JSI Tip 0527 - Can I install a font from a cmd prompt or a batch file?

When you install a font, the .ttf is copied to %SystemRoot%\Fonts and a font name Value is added to the registry at:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

as a type REG_SZ. The data string contains the font file name.
Here is a batch file that adds the "Bitstream Cyberbit (TrueType)" font:

copy <Drive:>\Folder\CYBERBIT.TTF %SystemRoot%\fonts\*.*
regedit /y <Drive:>\Folder\bitstream.reg
exit

where bitstream.reg contains:

REGEDIT4

\[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\]
"Bitstream Cyberbit (TrueType)"="CYBERBIT.TTF"

You must reboot Windows NT to use the font.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish