Sounds good. You should always post your code as it is a good reference for other people with similar projects.
Don't know if this will be of use to anyone here, but have created a small VB startup Script that can be used to install new fonts.
It just copies the files froma server and registers them.
If anyone would like it ill post the code and instructions?
Sounds good. You should always post your code as it is a good reference for other people with similar projects.
Love to see it SYSMAN - thanks
Definitely useful... please do post it up...
Yes Sysman. Get your script out for the geeks![]()
Here goes - I hope this makes some sense.
Create a Folder to house all your additional fonts on a network share e.g. \\%SERVERNAME%\%SHARE%\FONTS
Copy the new font to that share e.g. Twiggy-Bold.ttf
Install the new font onto a workstation.
Using regedit browse to the following Key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
Make a note of the new fonts registry information.
Add this new information to the VB script
Create a new GPO and add the script to run at computer start up
Assign to computers
The font will be available after a restart of the PC with no need for an admin logon.
To update the script quickly I just created a shortcut to the policy folder and then just copy the updated VB script when I have added new fonts.
And here's the code
Code:' **************************************************************************** ' Copy Fonts From Network Share To C:\WINDOWS\FONTS Folder Of Workstation ' **************************************************************************** Set WshShell = CreateObject("WScript.Shell") WshShell.Run "xcopy.exe ""\\%SERVERNAME%\%SHARE \FONTS"" ""C:\windows\fonts"" /C /I /S /E /H /Y /Q", 1,True ' **************************************************************************** ' Imports The Registry Information For The New Fonts - Add A New Line For Each New Font ' Example : WshShell. RegWrite"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\%FONT REG KEY%", "%FONT REG KEY ENTRY%", "REG_SZ" ' **************************************************************************** Set WshShell = WScript.CreateObject("WScript.Shell") WshShell. RegWrite"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\Twiggy-Bold (TrueType)", "Twiggy-Bold.ttf", "REG_SZ" WshShell. RegWrite"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\Twiggy-Light (TrueType)", "Twiggy-Light.ttf", "REG_SZ"
Thanks for sharing... I suspect that's going to make life a lot easier![]()
Thought this might be good for some people on the same topic it shows you how to make an installer for custom fonts.
http://www.ryanvm.net/forum/viewtopi...d56886e79aa580
reggiep (20th March 2014)
Great work .. really informative .. and thanks a lot for sharing ..
thanks so much for useful info
script install

Copying the fonts and writing the registry keys will work but sometimes seems to need a restart of Explorer (so if you run this at startup then the fonts will be there the next time the machine starts).
The link from @chrish looks fine but it looks like hard work :-)
MS provide scripting support for installing fonts - the code I've used is below. Basically, put any fonts you want installing in a server folder (\\server\share\fonts in the example) and then call this code as an extra sub-routine in your machine startup script.
If you ever want to add a new font, just copy it to the server; next time the machines reboot they'll install it.
Code:Sub InstallFonts on error resume next Const FONTS = &H14 dim , oFSO,oShell, oFolder1, oFolder2, sRoot sRoot="\\server\share\fonts\" Set oShell = CreateObject("Shell.Application") set oFSO=createobject("scripting.filesystemobject") Set oFolder1 = oShell.Namespace(FONTS) set oFolder2=ofso.getfolder(sRoot) for each oFile in oFolder2.files sName=lcase(oFile.name) if right(sName,4)=".ttf" then if not ofso.fileexists(oFolder1.self.path & "\" & sName) then oFolder1.copyhere sRoot & sName end if end if next on error goto 0 End Sub
dhicks (10th August 2009), Jon_boy1984 (1st March 2012), ozydave (1st December 2009), projector1 (15th June 2010), stevenlong1985 (28th February 2011)
ozydave (1st December 2009)
Tried this today - could I get it to work ? No!
I created a new folder on the server called fonts, shared it, full control for everyone. Copied the script, changed the server path tested it and it worked. So copied the script to Group Policy (server 2008) computer's startup scripts, rebooted the machines and it doesn't work. I have other scripts that work in the same OU. Any ideas anyone?

Add in some debugging:
- add the "olog" lines and it should write a log file to c:\windows\temp\fonts.log with some info about what's happening.Code:Sub InstallFonts on error resume next Const FONTS = &H14 dim , oFSO,oShell, oFolder1, oFolder2, sRoot sRoot="\\server\share\fonts\" Set oShell = CreateObject("Shell.Application") set oFSO=createobject("scripting.filesystemobject") set oLog=ofso.createtextfile("c:\windows\temp\fonts.log",true) Set oFolder1 = oShell.Namespace(FONTS) set oFolder2=ofso.getfolder(sRoot) for each oFile in oFolder2.files sName=lcase(oFile.name) oLog.writeLine "found: " & sName if right(sName,4)=".ttf" then if not ofso.fileexists(oFolder1.self.path & "\" & sName) then oLog.writeLine "installing: " & sName oFolder1.copyhere sRoot & sName end if end if next on error goto 0 oLog.close End Sub
If that file doesn't get created then the script just isn't running. If it gets created and it appears to not find any fonts then your script isn't able to read the fonts directory (remember you must have "domain computers" with read access to get that to work)
Sorted thanks, added authenticated users to fonts folder!
There are currently 1 users browsing this thread. (0 members and 1 guests)