Improve company productivity with a Business Account.Sign Up
On Error Resume Next
Set Args = WScript.Arguments
FontPath = Args.Item(0)
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FontFolder = FSO.GetFolder(FontPath)
Set FileCollection = FontFolder.Files
For Each FontFile in FileCollection
'Install Open Type Fonts and True Type Fonts
If Right(FontFile.Name, 4) = ".ttf" Or Right(FontFile.Name, 4) = ".otf" Then Call InstallFonts(FontPath, FontFile.Name)
Sub InstallFonts(FontPath, FontFileName)
Set Shell = CreateObject("Shell.Application")
Set Folder = Shell.Namespace(FontPath)
Set FontItem = Folder.ParseName(FontFileName)
If Err.Number > 0 Then
WScript.Echo "Error: Font installation attempt may have failed."
Set Args = Nothing
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.