Link to home
Start Free TrialLog in
Avatar of Jeffrey Renfroe
Jeffrey RenfroeFlag for United States of America

asked on

Install fonts with vbs

Hello. I need to install new fonts on multiple Windows 7 machines. I found a blog that shows how to install one font using a vbs. Since I need to install multiple fonts, I modified the script.

My questions is were my modifications the best approach or is there a better way to do it?

Thank you for any information.

http://blogs.technet.com/b/rspitz/archive/2010/09/25/how-to-install-a-font-from-the-command-line-on-windows-7.aspx
UNIVCD47
UNIVCD67
Unvr57
Unvr58
Unvr67
Unvr68

Sub UNIVCD47
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\temp")
Set objFolderItem = objFolder.ParseName("UNIVCD47.ttf")
objFolderItem.InvokeVerb("Install")
End Sub

Sub UNIVCD67
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\temp")
Set objFolderItem = objFolder.ParseName("UNIVCD67.ttf")
objFolderItem.InvokeVerb("Install")
End Sub

Sub Unvr57
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\temp")
Set objFolderItem = objFolder.ParseName("Unvr57.ttf")
objFolderItem.InvokeVerb("Install")
End Sub

Sub Unvr58
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\temp")
Set objFolderItem = objFolder.ParseName("Unvr58.ttf")
objFolderItem.InvokeVerb("Install")
End Sub

Sub Unvr67
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\temp")
Set objFolderItem = objFolder.ParseName("Unvr67.ttf")
objFolderItem.InvokeVerb("Install")
End Sub

Sub Unvr68
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\temp")
Set objFolderItem = objFolder.ParseName("Unvr68.ttf")
objFolderItem.InvokeVerb("Install")
End Sub

Open in new window

Avatar of rawinnlnx9
rawinnlnx9
Flag of United States of America image

There are more efficient ways to do it with loops and by building a list from the directory contents but this works.
Are you wanting an example just so you know?
Avatar of Jeffrey Renfroe

ASKER

An example would be great if you could show me one.
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Renfroe
Jeffrey Renfroe
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Figured out how to do with with an array and loop