Jump to content
shnladd

UAC interfering with font addition?

Recommended Posts

I'm working on a script to deploy some TTF font files to a client but am running up against a wall at the last stage. My script is successfully able to download a 7zip archive containing the TTF files and the FontReg.exe utility to install them, along with the 7z binary and library, and decompress the archive. However, when the time comes to run "C:\LTTemp\FontReg.exe /copy" to deploy the fonts, the script either hangs until a reboot or reports success with no actual results.

 

Running FontReg.exe /copy from the shell manually on the endpoint brings up a UAC prompt. I'm not sure which shell command I should be configuring in Labtech (shell as admin, shell as user, shell enhanced, plain shell) but what I've tried so far - Admin, User with known-good domain creds, and plain shell - doesn't seem to actually install and register the font files.

 

Can anyone help me see what I'm doing wrong? I have a feeling like it's something obvious that I'm missing but I can't make out what it is right now. Thanks!

Share this post


Link to post
Share on other sites

If UAC is interfering, Run As Admin and Run As User will likely fail. The straight "Execute Shell" function will run with SYSTEM privileges, which resolves UAC but adds other wrinkles.

A little Google for FONTREG.EXE brought a readme with some possibly relevant info? (From https://www.richud.com/wiki/Windows_Fontreg_install_fonts_locally_or_remotely_easily)

The CWD must be where the fonts are! You cant execute the .exe from elsewhere otherwise it wont do anything (still returns errorcode 0 though).

That suggests that your command line should be:

CD /D "@PATHTOEXTRACTEDFONTS@" & FONTREG.EXE /copy

This page even has an example batch file that you could drop into an "Execute Script" batch function step: http://texhex.blogspot.com/2012/06/silent-installation-of-ttf-fonts-on.html

Share this post


Link to post
Share on other sites

I have a little script which installs fonts. It downloads this .vbs file from my server:

strPath = WScript.Arguments.Item(0)
strFontname = WScript.Arguments.Item(1)
wscript.echo  "Installing font from " & strPath & StrFontName
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(strPath)
Set objFolderItem = objFolder.ParseName(strFontname)
objFolderItem.InvokeVerb("Install")

which I drop into a temp folder, along with the font file. The script takes a path and filename.

 

All I do in my automate script is download the above vbs and the ttf. I then shell

cscript above-file.vbs c:\temp\myfont.ttf

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...