Monday, 23 March 2009

Roll out a new font to every user in your domain

Our new marketing manager decided that we needed a new font rolled out to all of the users in the company. Not wanting to visit every user, I came up with a handy VB script which I call during the user logon script.

There may well be more efficient ways of doing this but this seemed to do the job!

----------------------------------------------------------------

Const FONTS = &H14&

Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(FONTS)
Set objFSO = CreateObject("Scripting.FileSystemObject")
set shell = WScript.CreateObject("WScript.Shell")

windowsdir = shell.ExpandEnvironmentStrings("%windir%")
File1 =windowsdir+"\fonts\Fontname1.otf"
File2 =windowsdir+"\fonts\Fontname2.otf"

If objFSO.FileExists (FILE1) then
wscript.quit
end if

If objFSO.FileExists (FILE2) then
wscript.quit
end if

objFolder.CopyHere "\\server\share\fonts\Fontname1.otf"
objFolder.CopyHere "\\server\share\fonts\Fontname2.otf"

----------------------------------------------------------------

At the time of writing, I have still not recieved an email or document written in the new font....

0 comments: