?
Solved

Install fonts with vbs

Posted on 2011-02-22
5
Medium Priority
?
1,893 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
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

850 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