Fonts Uninstalling

We've encountered a strnage issue with several fonts uninstalling themselves.  We have the following script run as part of the computer logon script to install the fonts.  For some reason these fonts are now not present on several systems that should have them and have had them in the past.  What could cause a script to uninstall?
Const FONTS = &H14&
Set objShell = CreateObject("Shell.Application")
Set objShell2 = CreateObject("WScript.Shell")
Set objFolder = objShell.Namespace(FONTS)
Set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.FolderExists("C:\Winnt\Fonts") Then 
objShell2.Run "cmd /c attrib +s +r C:\Winnt\Fonts ", 0, True
End If


If objFSO.FileExists(objFolder.Self.Path & "\CONDBD.ttf") = False Then 
objFolder.CopyHere "\\domain name\netlogon\BSI Fonts\CONDBD.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\CONDBDIT.ttf") = False Then 
objFolder.CopyHere "\\domain name\netlogon\BSI Fonts\CONDBDIT.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\CONDMD.ttf") = False Then
objFolder.CopyHere "\\domain name\netlogon\BSI Fonts\CONDMD.ttf", 16
End If



If objFSO.FileExists(objFolder.Self.Path & "\CONDMDIT.ttf") = False Then
objFolder.CopyHere "\\domain name\netlogon\BSI Fonts\CONDMDIT.ttf", 16
End If



If objFSO.FileExists(objFolder.Self.Path & "\PIFONT.ttf") = False Then
objFolder.CopyHere "\\domain name\netlogon\BSI Fonts\PIFONT.ttf", 16
End If


If objFSO.FileExists(objFolder.Self.Path & "\SANSBD.ttf") = False Then
objFolder.CopyHere "\\domain name\netlogon\BSI Fonts\SANSBD.ttf", 16
End If


If objFSO.FileExists(objFolder.Self.Path & "\SANSBDIT.ttf") = False Then
objFolder.CopyHere "\\domain name\netlogon\BSI Fonts\SANSBDIT.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\SANSMD.ttf") = False Then
objFolder.CopyHere "\\domain name\netlogon\BSI Fonts\SANSMD.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\SANSMDIT.ttf") = False Then
objFolder.CopyHere "\\domain name\netlogon\BSI Fonts\SANSMDIT.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\SERFBD.ttf") = False Then
objFolder.CopyHere "\\domain name\netlogon\BSI Fonts\SERFBD.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\SERFBDIT.ttf") = False Then
objFolder.CopyHere "\\domain name\netlogon\BSI Fonts\SERFBDIT.ttf", 16
End If


If objFSO.FileExists(objFolder.Self.Path & "\SERFMD.ttf") = False Then
objFolder.CopyHere "\\domain name\netlogon\BSI Fonts\SERFMD.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\SERFMDIT.ttf") = False Then
objFolder.CopyHere "\\domain name\netlogon\BSI Fonts\SERFMDIT.ttf", 16
End If

Open in new window

georgedschneiderAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jameslo-txCommented:
It's hard to say what might cause it, since it's as simple as deleting a file. You might want to start watching for it and putting the pieces together. You might set them as read-only, for example, and see if you get an error at some point as whatever it is tried to delete it.

You can also set up auditing on that folder to see if you can catch it.

Another clue might be in knowing if the only fonts that disappear.

I'd also make sure that once the code is run, the system does not continually run this script. Set a flag, either creating a file or putting a registry entry on the system (whatever breadcrumb you want to leave), and only run this if it has not been run before.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
georgedschneiderAuthor Commented:
Isn't running it as it currently constitutes essential doing that with only installing the fonts if  they don't already exists?

How could I create a log file/append a log file with a message stating Font Scripr Ran with a time date stamp?
0
Dr. KlahnPrincipal Software EngineerCommented:
Looking at the script, I wonder about

cmd /c attrib +s +r C:\Winnt\Fonts

That turns on system status and read-only protection for the directory before attempting to copy the fonts into it, which could be an issue.
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

georgedschneiderAuthor Commented:
The reason for that was we noticed on several of our Windows 2000 machines menu options were missing from the fonts folder as described in http://support.microsoft.com/kb/133725 and this was done to fix this error.  
0
georgedschneiderAuthor Commented:
I modified the script to create a text file to write a line indicating that the script ran.  The update script is below.  The log file exists on the workstations but no fonts.   Why wouldn't these fonts install?
Const FONTS = &H14&
CONST ForReading = 1, ForWriting = 2, ForAppending = 8

Set objShell = CreateObject("Shell.Application")
Set objShell2 = CreateObject("WScript.Shell")
Set objFolder = objShell.Namespace(FONTS)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objLogFile = objFSO.openTextFile("C:\BSI Fonts Log.txt",forappending, true)

If objFSO.FolderExists("C:\Winnt\Fonts") Then 
objShell2.Run "cmd /c attrib +s +r C:\Winnt\Fonts ", 0, True
End If


If objFSO.FileExists(objFolder.Self.Path & "\CONDBD.ttf") = False Then 
objFolder.CopyHere "\\Domain Name\netlogon\BSI Fonts\CONDBD.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\CONDBDIT.ttf") = False Then 
objFolder.CopyHere "\\Domain Name\netlogon\BSI Fonts\CONDBDIT.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\CONDMD.ttf") = False Then
objFolder.CopyHere "\\Domain Name\netlogon\BSI Fonts\CONDMD.ttf", 16
End If



If objFSO.FileExists(objFolder.Self.Path & "\CONDMDIT.ttf") = False Then
objFolder.CopyHere "\\Domain Name\netlogon\BSI Fonts\CONDMDIT.ttf", 16
End If



If objFSO.FileExists(objFolder.Self.Path & "\PIFONT.ttf") = False Then
objFolder.CopyHere "\\Domain Name\netlogon\BSI Fonts\PIFONT.ttf", 16
End If


If objFSO.FileExists(objFolder.Self.Path & "\SANSBD.ttf") = False Then
objFolder.CopyHere "\\Domain Name\netlogon\BSI Fonts\SANSBD.ttf", 16
End If


If objFSO.FileExists(objFolder.Self.Path & "\SANSBDIT.ttf") = False Then
objFolder.CopyHere "\\Domain Name\netlogon\BSI Fonts\SANSBDIT.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\SANSMD.ttf") = False Then
objFolder.CopyHere "\\Domain Name\netlogon\BSI Fonts\SANSMD.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\SANSMDIT.ttf") = False Then
objFolder.CopyHere "\\Domain Name\netlogon\BSI Fonts\SANSMDIT.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\SERFBD.ttf") = False Then
objFolder.CopyHere "\\Domain Name\netlogon\BSI Fonts\SERFBD.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\SERFBDIT.ttf") = False Then
objFolder.CopyHere "\\Domain Name\netlogon\BSI Fonts\SERFBDIT.ttf", 16
End If


If objFSO.FileExists(objFolder.Self.Path & "\SERFMD.ttf") = False Then
objFolder.CopyHere "\\Domain Name\netlogon\BSI Fonts\SERFMD.ttf", 16
End If

If objFSO.FileExists(objFolder.Self.Path & "\SERFMDIT.ttf") = False Then
objFolder.CopyHere "\\Domain Name\netlogon\BSI Fonts\SERFMDIT.ttf", 16
End If

objLogFile.WriteLine "BSI Fonts Installation Script Ran At: " & Now 

Open in new window

0
georgedschneiderAuthor Commented:
The strange thing is this I checked all the machines in question and the fonts are now there.  I'm not sure what including a log statement would do to cause the fonts to be installed.  Very strange.
0
georgedschneiderAuthor Commented:
I saw the same thing yesterday in that fonts weren't there and todat they were.  Do you think that eunning objShell2.Run "cmd /c attrib +s +r C:\Winnt\Fonts ", 0, True  to reset the attributes on the fonts directory could cause fonts to be misisng?
0
JustinGSEIWICommented:
Can this script be modified to delete fonts on computers? If so, how can I do that?

Thanks,

Justin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.