vbscript - Script to Install Font in Windows XP -
i trying install fonts in windows xp using vbscript. reason script works fine in windows 7 not work in windows xp. need install fonts without system reboot so, had choose approach instead of other registry change approaches need system reboot. here vbscript
set objshell = createobject("shell.application") set objfolder = objshell.namespace("d:\logs\") set objfolderitem = objfolder.parsename("roboto-italic.ttf") objfolderitem.invokeverb("install")
my guess invokeverb("install") command not working in windows xp. in case there alternatives? please guide me thanks...
next script (a code snippet) should work on (obsolete) windows xp:
const ssffonts = &h14& set objshell = createobject("shell.application") set objfolder = objshell.namespace(ssffonts) objfolder.copyhere "d:\logs\roboto-italic.ttf"
if font installed prompted overwrite it. not sure whether or not reboot required using above approach...
see shellspecialfolderconstants enumeration
specifies unique, system-independent values identify special folders. these folders used applications may not have same name or location on given system.
among others:
ssffonts 0x14 (20)
. virtual folder contains installed fonts. typical pathc:\windows\fonts
.
read hey, scripting guy! how can install fonts using script?:
as font has been added folder, operating system install font you...
that’s true, 1 important caveat: must copy file usingshell
object. admittedly, can usewmi
orfilesystemobject
copy filefonts
folder; however, when operating system not automatically install font you. far know, programmatic way windows recognize new font has been addedfonts
folder, , windows install font you, useshell
object.
Comments
Post a Comment