/build/static/layout/Breadcrumb_cap_w.png

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

 


0 Comments   [ + ] Show comments

Answers (2)

Answer Summary:
Remove or comment out the 'Wscript.Echo' lines and it should run through without the pop-ups.
Posted by: dunnpy 11 years ago
Red Belt
2

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
Posted by: afincher 11 years ago
Senior Purple Belt
-1

Why not just extract a zip of all the fonts directly to: %windir%\fonts?

Windows is "smart enough" to automatically detect them.

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ