Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
SourcePath = '\\server\share' FontFileName = 'sample.ttf' objShell = CreateObject("Shell.Application") objFolder = objShell.Namespace(SourcePath) objFolderItem = objFolder.ParseName(FontFileName) colVerbs = objFolderItem.Verbs ForEach objVerb in colVerbs If StrIndexNC(objVerb.name,'&I',1,@FWDSCAN) != 0 || StrIndexNC(objVerb.name,'Install',1,@FWDSCAN) != 0 objVerb.DoIt Break EndIf Next
;Installing a font in Windows NT/2000/XP ;---------------------------------------- ;Get path to font directory and copy font FontDir=RegQueryEx(@REGCURRENT,"Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders[Fonts]","",1) FileCopy("myfont.ttf",FontDir,@FALSE) ;Register font FontKey=RegOpenKey(@REGMACHINE,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts") RegSetValue(FontKey,"[My Font (TrueType)]","myfont.ttf") RegCloseKey(FontKey) ;Add the font to the font system DllName=StrCat(DirWindows(1),"gdi32.dll") DllCall(DllName,LONG:"AddFontResourceA",lpstr:"myfont.ttf") ;Inform running apps about the new font IntControl(22,-1,29,0,0)The last line is only needed if currently running applications should be informed about the font addition. All apps started after the installation will recognize the new font even without the IntControl call.
Article ID: W15929
File Created: 2013:10:15:09:54:18
Last Updated: 2013:10:15:09:54:18