Here is a script that works.
Code:
Const FONTS = &H14&
Dim wsh
Set wsh = WScript.CreateObject("Wscript.Shell")
function LogtoEvent (MSG,success)
select case success
case 1 wsh.LogEvent EVENT_SUCCESS, MSG ' 1 is a success
case 0 wsh.LogEvent EVENT_FAILURE, MSG ' 0 is a error
case 2 wsh.LogEvent EVENT_WARNING, MSG ' 2 is a warning
case 3 wsh.LogEvent EVENT_INFORMATION, MSG ' do not use
end select
end function
LogtoEvent "INSTALL FONTS: Started Installing Fonts",1
strSource = "\\{UNC PATH TO DIR WITH FONTS}"
arrFiles = Array("{FONT NAME.ttf", "{ANOTHER FONT NAME.ttf}")
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(FONTS)
For Each strFile in arrFiles
Set objFolderItem = objFolder.ParseName(strFile)
If objFolderItem is nothing Then
LogtoEvent "INSTALL FONTS: Installing " & strFile,1
objFolder.CopyHere strSource & "\" & strFile, &H4&
End If
Next
LogtoEvent "INSTALL FONTS: Done",1 This leaves entries in the event log too ftw