Home » Install Fonts from a VBScript

Simply copying fonts into the fonts folder using a VB script doesn’t actually install them.

To install the fonts you have to use the following code:

Const FONTS = &H14&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(FONTS)
objFolder.CopyHere "C:ScriptsMyfont.ttf"
Home » Install Fonts from a VBScript


  • Ahmed

    how to uninstall the font also using vbs ?

    • http://www.mikesel.info/ Mike Hudson

      Hello Ahmed

      Deleting the file but be the ‘reverse’ of the above code

      Set objFSO = CreateObject(“Scripting.FileSystemObject”)objFSO.DeleteFile(“C:WindowsFontsArial.ttf”)

      You would need to replace the file path with that of the font you wish to delete.

      Thanks
      Mike

  • Ahmed

    how to uninstall the font also using vbs ?

    • http://www.mikesel.info/ Mike Hudson

      Hello Ahmed

      Deleting the file but be the ‘reverse’ of the above code

      Set objFSO = CreateObject(“Scripting.FileSystemObject”)objFSO.DeleteFile(“C:WindowsFontsArial.ttf”)

      You would need to replace the file path with that of the font you wish to delete.

      Thanks
      Mike


Page 1 of 11