Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to understand Select - Case

Status
Not open for further replies.

johnhenri

MIS
Dec 8, 2014
2
DE
Hi,

Forgive me if I seem thick... I am not a programmer...

Im trying to achieve a simple task:
I have five fonts I need to install on many clients, some have none, one, or more of the fonts already installed. I have found the VBScript code to do the installation of one, and to check if the file already exists in the FONTS-folder.

Code:
Const FONTS = &H14&
Set objShell = CreateObject("Shell.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objShell.Namespace(FONTS)
If objFSO.FileExists("C:\Windows\Fonts\spranq_eco_sans_regular.ttf") Then
Wscript.Quit
Else
objFolder.CopyHere "\\192.168.104.225\sysvol\EcoFont\spranq_eco_sans_regular.ttf"
End If

I would like to extend this to check if the file does NOT exist, then install it, and do this with five fonts. I have found that I should use Select - Case, but I can not, for the love of everything sacred, figure out how I should construct the code.

Can someone help me?

Best Regards/
John-Henri
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top