9 replies
by tben
I believe you can copy the font file into the font folder.. and that ought to do the trick
Its easy if the users uses a login script
by jackman775
Poster rated this answer.
by jonathanpdx
by jackman775
Poster rated this answer.
by jackman775
by jcurrie
Unfortionatly, you can not remotely copy the files into the folder via script or otherwise. This is due to the fact that the fonts must be registered to work properly. If you are logged into the console of a workstation and you copy the font files into the windows\fonts directory, Windows will automatically register them. However, if you do this romotely or via script, Windows will not detect this and therefore will not resgister the fonts.
You can acheive this via script though it is not as easy as you would think (or like it to be). Their are several considerations to make here.
First this is usually easier accomplished with a login script instaed of a startup script. However, this introduces some complications in that login scripts run under the users credentials not the local system credentials. Therefore, unless your users have permissions to the file system AND have permissions to register fonts, the script will fail. This can be overcome by using impersonation in your script, BUT BEWARE, this means you will need to provide clear text login credientials for an administrative account in your script (this is very bad security practice). There are ways around this especially with .Net but now we are getting even more complexities which are out of the scope of this thread.
Second. You will not only need to write the code to complete your file copy, but you will need to manually register the font as well. Basically this consists of writing a value to the registry under
HKLM\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Fonts
Below is a script that might do the trick for you. Please keep in mind that I HAVE NOT TESTED THIS. This was submited by one of my technicians to me some time ago and I have never used it. You will very likely need to do some tweaking and testing for your environment.
by jcurrie
Just an FYI, I actually find it much easier to package my font distributions into an MSI. This is actually quite trivial, and would take far less time then tweaking and testing the script below. You can natively deploy the MSI to targeted computers through Group Policy. The only catch is that you need an MSI packager. Considering your time investment, that would likely be less expensive then tweaking and testing the script below as well.
' Start of script
Option Explicit
Dim strAddedFonts, updated, sComputer, fso, oReg, strRegValue, sFontName, sFontFile, strIFN
Const HKLM = &H80000002
sComputer = InputBox("What is the computername ","Register Fonts","COMPUTERNAME",1,1)
updated= "Following fonts have been"&vbCr &"registed on "&sComputer &vbCr &vbcr
Set Fso = CreateObject("Scripting.FileSystemObject")
Set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & sComputer & "\root\default:StdRegProv")
strRegvalue = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
sFontName = "Kartika (TrueType)"
sFontFile ="Kartika.ttf"
FontUpdate ()
msgbox updated
Function FontUpdate ()
' Place code here to copy files from central repository
' to the target PC
strIFN = "\\"&sComputer &"\C$\Windows\Fonts\"&sFontFile
If Fso.FileExists(strIFN) Then
updated = updated & sFontFile &VbCr
oReg.SetStringValue HKLM, strRegvalue, sFontName, sFontFile
end if
End function
' end of script
by jackman775
Poster rated this answer.
by jackman775
This discussion is closed to new replies.
Trending Desktop posts
Sort by Trending