I have a vbscript i've written that checks for a set of 55 fonts within C:\Windows\Fonts. We will consider this the "approved" list. This list does contain all fonts required for a windows xp install to function.
Now, I have been asked to delete all fonts in C:\Windows\Fonts that are not part of this list. Below you can see some of the code snippet (i've simplified it a bit):
Dim aFonts(3)
aFonts(0) = "arial.ttf"
aFonts(1) = "arialbd.ttf"
aFonts(2) = "arialbi.ttf"
x=0
For Each item In aFonts
If Not objFSO.FileExists("C:\Windows\Fonts\" & aFonts(x)) Then objFolder.CopyHere ("\\server\WinFonts\" & aFonts(x))
x=x+1
Next
The install of the fonts if they are not found works perfectly, however I am struggling with comparing the filenames in C:\Windows\Fonts on a computer to my aFonts() array.
Now, I have been asked to delete all fonts in C:\Windows\Fonts that are not part of this list. Below you can see some of the code snippet (i've simplified it a bit):
Dim aFonts(3)
aFonts(0) = "arial.ttf"
aFonts(1) = "arialbd.ttf"
aFonts(2) = "arialbi.ttf"
x=0
For Each item In aFonts
If Not objFSO.FileExists("C:\Windows\Fonts\" & aFonts(x)) Then objFolder.CopyHere ("\\server\WinFonts\" & aFonts(x))
x=x+1
Next
The install of the fonts if they are not found works perfectly, however I am struggling with comparing the filenames in C:\Windows\Fonts on a computer to my aFonts() array.