I found a script for install fonts and I edited it to install some fonts (array of fonts) alongside but it doesn't run. This line raises an error:
array.InvokeVerb("Install")
It seems to replace InvokeVerb with another function but I dont know!
Can some one help me?
My script:
Option Explicit
'Installing multiple Fonts in Windows 7
Dim objShell, objFSO, wshShell
Dim strFontSourcePath, objFolder, objFont, objNameSpace, objFile
Dim array : Set array = CreateObject("System.Collections.ArrayList")
Set objShell = CreateObject("Shell.Application")
Set wshShell = CreateObject("WScript.Shell")
Set objFSO = createobject("Scripting.Filesystemobject")
strFontSourcePath = "C:\Users\Win7\Desktop\new_Software\Fonts"
If objFSO.FolderExists(strFontSourcePath) Then
Set objNameSpace = objShell.Namespace(strFontSourcePath)
Set objFolder = objFSO.GetFolder(strFontSourcePath)
For Each objFile In objFolder.Files
If LCase(Right(objFile,4)) = ".ttf" Or LCase(Right(objFile,4)) = ".otf" Then
array.Add objNameSpace.ParseName(objFile.Name)
End If
Next
array.InvokeVerb("Install")
Else
WScript.Echo "Font Source Path does not exists"
End If
InvokeVerbin theFor ... Nextloop.