Page 1 of 1 1
Topic Options
#17121 - 2002-02-06 05:53 PM Font register
MrMatt Offline
Lurker

Registered: 2002-01-10
Posts: 2
Loc: Halifax, England
Hi,

I want to write a script that will deliver and register a font to workstations, without re-booting the machine. The syntax I'm using is: COPY "./HBOS.ttf" "c:\winnt\system32\HBOS.ttf"

WRITEVALUE ("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts","HBOS (TrueType)","HBOS.ttf", REG_SZ)

However the machine then needs to be rebooted before the font is available in Word etc.

Can this be done without re-booting?

Top
#17122 - 2002-02-06 10:50 PM Re: Font register
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
MrMatt,

Why aren't you doing the following?

code:

COPY "./HBOS.ttf" "%windir%\fonts\HBOS.ttf"

I believe (of course I could be wrong) once you copy to this "magical" folder, the system auto-registers the font(s) for you.

HTH,

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#17123 - 2003-05-28 04:51 PM Re: Font register
singk Offline
Fresh Scripter

Registered: 2002-02-14
Posts: 31
I have a code below that worked on Win2k, but it doesn't work on WinXP. I know it's not the permission issues because the copy statement worked and I'm logon as Domain Administrator.

code:
      ; Check if DURA font installed
$Font=ReadValue($HKLMS + "Microsoft\Windows NT\CurrentVersion\Fonts","Dura (TrueType)")
If @ERROR <> 0
COPY $LogonDrv + "\GOR\BIN\dura____.ttf" "%WINDIR%\FONTS"
$Nul=WriteValue($HKLMS + "Microsoft NT\Windows\CurrentVersion\Fonts","Dura (TrueType)","dura____.ttf","REG_SZ")
EndIf

The code ran without any error. The writevalue statement also return zero, so it proves that there's no error, but somehow this key never get added. I also check to see if dura_____.ttf copied to %windir%\fonts, and it did.

Can someone help, please?

Thanks
Singk
_________________________
Thanks, Sing

Top
#17124 - 2003-05-28 05:18 PM Re: Font register
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
Try the InstallFont() - Install Font(s) UDF from the UDF Forum.
_________________________
There are two types of vessels, submarines and targets.

Top
#17125 - 2003-05-28 07:42 PM Re: Font register
singk Offline
Fresh Scripter

Registered: 2002-02-14
Posts: 31
OOPS, I found what was the problem with my code. I somehow write to a wrong key. It must got change when I modified for Windows XP.

BAD coding:
code:
       ; Check if DURA font installed
$Font=ReadValue($HKLMS + "Microsoft\Windows NT\CurrentVersion\Fonts","Dura (TrueType)")
If @ERROR <> 0 COPY $LogonDrv + "\GOR\BIN\dura____.ttf" "%WINDIR%\FONTS"
$Nul=WriteValue($HKLMS + "Microsoft NT\Windows\CurrentVersion\Fonts","Dura (TrueType)","dura____.ttf","REG_SZ")
EndIf

Here's the CORRECT coding:
code:
       ; Check if DURA font installed
$Font=ReadValue($HKLMS + "Microsoft\Windows NT\CurrentVersion\Fonts","Dura (TrueType)")
If @ERROR <> 0 COPY $LogonDrv + "\GOR\BIN\dura____.ttf" "%WINDIR%\FONTS"
$Nul=WriteValue($HKLMS + "Microsoft\Windows NT\CurrentVersion\Fonts","Dura (TrueType)","dura____.ttf","REG_SZ")
EndIf

Also, I could use InstallFont() by Lonkero, but since I have only one font to be added, I will use the code above because it's simpler.

Thanks,
Singk
_________________________
Thanks, Sing

Top
#17126 - 2003-05-28 07:48 PM Re: Font register
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
HKEY_LOCAL_MACHINE requires administrative privileges under Windows NT/2000/XP/2003
_________________________
There are two types of vessels, submarines and targets.

Top
#17127 - 2003-05-28 09:00 PM Re: Font register
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22333
Loc: OK
singk, dunno what is simple.
if you use udf's in your logonscripts you soon realize that they are darn simple.

they are just kinda extensions to the default kixtart-language.
just like in programming languages [Wink]

once you get a hang of it, you won't stop loving them.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
3 registered (fergieman101, Glenn Barnas, Mart) and 183 anonymous users online.
Newest Members
emnipetro, Hirze, thequeen, ameliaryan, shalomsalami
17641 Registered Users

Generated in 0.031 seconds in which 0.011 seconds were spent on a total of 12 queries. Zlib compression enabled.

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