Need help deploying fonts silently via .vbs
I need to deploy barcode fonts to about 600 machines. I found a script that succesfully installs the fonts, but relies on user intervention, I would like to remove their intervention altogether. I created an online shell script to deploy the fonts, and I use commandline wscript "barcode fonts.vbs" to call on the VB script. Here is my VB script:
Option Explicit
' Installing multiple Fonts in Windows 7
Dim objShell, objFSO, wshShell
Dim strFontSourcePath, objFolder, objFont, objNameSpace, objFile
Set objShell = CreateObject("Shell.Application")
Set wshShell = CreateObject("WScript.Shell")
Set objFSO = createobject("Scripting.Filesystemobject")
Wscript.Echo "--------------------------------------"
Wscript.Echo " Install Fonts "
Wscript.Echo "--------------------------------------"
Wscript.Echo " "
strFontSourcePath = "\\Servername\share\Barcode 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
If objFSO.FileExists("C:\Windows\Fonts\" & objFile.Name) Then
Wscript.Echo "Font already installed: " & objFile.Name
Else
Set objFont = objNameSpace.ParseName(objFile.Name)
objFont.InvokeVerb("Install")
Wscript.Echo "Installed Font: " & objFile.Name
Set objFont = Nothing
End If
End If
Next
Else
Wscript.Echo "Font Source Path does not exists"
End If
Answers (2)
Remove or comment out the 'Wscript.Echo' lines and it should run through without the pop-ups.
Remove or comment out the 'Wscript.Echo' lines and it should run through without the pop-ups.
Dunnpy
Comments:
-
Commenting out the 'Wscript.Echo' lines worked perfectly! - toucan911 11 years ago