sorry forgot the link:
install font with command line or script in windows 7
If you are looking for an easy way to intall fonts in windows 7 with a little script.
you can find it for free on our page:
zachariah (30th January 2012)
Excellent script from maximator152 there - thanks!
Also, here is a page with easy details to quickly make an msi for one or more fonts:
(you'll need to have a copy of WininstallerLE, which I think is still free)
I've used that method with no problems so far. The only slight inconvenience is the machines need a restart after the msi has run before the font is visible to the user.
I've used fontreg for this in the past, have just put it in some package folder alongside the font files and run: fontreg /copy
Last edited by PiqueABoo; 19th February 2012 at 03:42 PM.
I will post my script later.....
Wow good old info this thread was started in 2006.
Here is the script that I wrote the other day. It looks in a server folder for font files and installs them. It also checks if the font is already installed and then skips over it if it is, and then adds into the event log that the font was installed. We use this as a package on SCCM and push it out when we approve new fonts.
Code:Const FONTS = &H14& 'defining variables Dim FSO, fontPath, objShell, objFolder, wshShell, winDir 'setting variables Set FSO = CreateObject( "Scripting.FileSystemObject" ) Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.Namespace(FONTS) Set wshShell = WScript.CreateObject( "WScript.Shell" ) 'setting strings fontPath = "\\servername\Fonts\" 'Change this folder path to font folder winDir = wshShell.ExpandEnvironmentStrings( "%windir%" ) For Each font In FSO.GetFolder( fontPath ).Files If( FSO.FileExists( winDir & "\fonts\" & FSO.GetFileName( font ) ) ) Then 'do nothing Else 'checking if file is a font If inStr( LCase( FSO.GetFileName( font ) ), "ttf" ) Or _ inStr( LCase( FSO.GetFileName( font ) ), "otf" ) Or _ inStr( LCase( FSO.GetFileName( font ) ), "fon" ) Then 'Installing font objFolder.CopyHere fontPath & FSO.GetFileName( font ), &H14& 'Add event to event viewer wshShell.LogEvent 4, "The " & FSO.GetFileName( font ) & " font has been installed." End If End If Next
We use PowerShell to install fonts, this is the code
Code:$path = "<path to font>\<font name>.ttf" $sa = new-object -comobject shell.application $Fonts = $sa.NameSpace(0x14) $Fonts.copyhere($path)
There are currently 1 users browsing this thread. (0 members and 1 guests)