Link to home
Start Free TrialLog in
Avatar of georgedschneider
georgedschneiderFlag for United States of America

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of jameslo-tx
jameslo-tx

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of georgedschneider

ASKER

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?
SOLUTION
Avatar of Dr. Klahn
Dr. Klahn

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.  
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

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.
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?
Avatar of JustinGSEIWI
JustinGSEIWI

Can this script be modified to delete fonts on computers? If so, how can I do that?

Thanks,

Justin