Page 1 of 1 1
Topic Options
#175906 - 2007-05-02 05:12 PM Uninstalling Fonts?
eriqjaffe Offline
Hey THIS is FUN

Registered: 2004-06-24
Posts: 214
Loc: Arlington Heights, IL USA
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)

Top
#175910 - 2007-05-02 06:19 PM Re: Uninstalling Fonts? [Re: eriqjaffe]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
I see that HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts is Read-Only for Users. You do run this script with Admin privileges, don't you?
Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.05 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org