This topic contains 4 replies, has 2 voices, and was last updated by
October 28, 2015 at 6:26 am #31425
I'm tring to write a script that'll install a folder of fonts acrross our domain, I'll push it out using group policy.
I understand that it's not enough to just copy the fonts to C:\windows\fonts these days and that you need to use the shell.application to register the fonts. Howver if I run :
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace("C:\fonts")
Set objFolderItem = objFolder.ParseName("sbd_____.pfm")
Nothing happens, with either otf,ttf or .pfm fonts. The fonts are copied to the fonts folder but don't show up in apps or in the registry.
The fonts only install if I add : objFolderItem.InvokeVerb("Install")
Is this line literally doign the same thing as i do if I manually install the font when right clicking the file?
My powershell script looks like :
$FONTS = 0x14
$objShell = New-Object -ComObject Shell.Application
$objFolder = $objShell.Namespace($FONTS)
Again, this only copies the fonts, they don't show up in apps of the registry. Is there an equivalent in powershell for objFolderItem.InvokeVerb("Install")?
I managed to find that the font folders have a verb named &install which is the install option from the fonts contextual menu. There must be a way to run that? Invoke-Item?
Thanks fro any help.
October 28, 2015 at 6:42 am #31429ParticipantPoints: 0Rank: Member
What happens if you do:
$objFolderItem = $objFolder.Self $objFolderItem.InvokeVerb("Install")
October 28, 2015 at 6:51 am #31431
Should I add those to my script or execute on their own? If I execute on their own nothing seems to happen. No fonts are installed in the font folder.
October 28, 2015 at 6:57 am #31435
ok, I added those lines to the end of my script.....the fonts are copied over, but not available to any apps.
The install progress bar doesn't appear the way it does when you run the vb version of the install command.
October 28, 2015 at 7:19 am #31439ParticipantPoints: 0Rank: Member
Found this article on msdn. At the bottom in the comments section, there is a powershell script.
The topic ‘Adding Fonts with Powershell?’ is closed to new replies.