I know that a UDF exists to install fonts, but I need to go through a bunch of systems and remove unlicensed fonts...does anybody know if that can be done via KiXtart?

For reference, here's what I've got so far:

 Code:
$FontDir = ExpandEnvironmentVars("%WINDIR%") + "\Fonts"

SHELL "%comspec% /c xcopy " + $FontDir + "\*.* c:\fontbackup\ /e /y"

$Whitelist = ReadFile(@SCRIPTDIR + "\font_whitelist.txt")

$FontKey = "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"

if KeyExist($FontKey)
   $Fonts = qs(arrayenumvalue($FontKey))
   for each $Font in $Fonts
       $TTF = ReadValue($FontKey,$Font)
       if ASCAN($Whitelist,$TTF) <> -1
          ? $TTF + " is on whitelist, no action taken."
       else
          ? $TTF + " is not on whitelist, deleting..."
          ; and this is where I was being stupid  ;)
       endif
   next
endif

Simply navigating to the fonts directory and deleting the .TTF file doesn't work, as Windows still thinks the font is "installed", and for some reason deleting the key in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts isn't working, either. Any ideas?

edit: Once I realized that I was trying to delete a registry value with DelKey instead of DelValue, things worked much better. Nevermind!


Edited by eriqjaffe (2007-05-02 06:19 PM)