[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Install fonts with vbs

Posted on 2011-02-22
5
Medium Priority
?
1,846 Views
Last Modified: 2012-06-27
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

0
Comment
Question by:Lorrec
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:rawinnlnx9
ID: 34953020
There are more efficient ways to do it with loops and by building a list from the directory contents but this works.
0
 
LVL 9

Expert Comment

by:rawinnlnx9
ID: 34953036
Are you wanting an example just so you know?
0
 

Author Comment

by:Lorrec
ID: 34953160
An example would be great if you could show me one.
0
 

Accepted Solution

by:
Lorrec earned 0 total points
ID: 34955628
I figure it out.  
Dim Fonts(5)
Fonts(0) = "UNIVCD47.ttf"
Fonts(1) = "UNIVCD67.ttf"
Fonts(2) = "Unvr57.ttf"
Fonts(3) = "Unvr58.ttf"
Fonts(4) = "Unvr67.ttf"
Fonts(5) = "Unvr68.ttf"

For Each item In Fonts
	Set objShell = CreateObject("Shell.Application")
	Set objFolder = objShell.Namespace("C:\temp")
	Set objFolderItem = objFolder.ParseName(item)
	objFolderItem.InvokeVerb("Install")
Next

Open in new window

0
 

Author Closing Comment

by:Lorrec
ID: 34990858
Figured out how to do with with an array and loop
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This script will sweep a range of IP addresses (class c only, 255.255.255.0) and report to a log the version of office installed. What it does: 1.)      Creates log file in the directory the script is run from (if it doesn't already exist) 2.)      Sweep…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question