注册字体
fonts\InstallFonts.vbs
1 Const FONTS = &H14& 2 fontPath = Left(Wscript.ScriptFullName, Len(Wscript.ScriptFullName) - Len(Wscript.ScriptName)) 3 Set objFSO = CreateObject("Scripting.FileSystemObject") 4 Set objShell = CreateObject("Shell.Application") 5 Set objFolder = objShell.Namespace(FONTS) 6 Set sourceFolder = objFSO.GetFolder(fontPath) 7 for each sourceFont in sourceFolder.Files 8 fontName = Lcase(sourceFont.Name) 9 if (Right(fontName, 4) = ".ttf") or (Right(fontName, 4) = ".ttc") then 10 if not objFSO.FileExists(objFolder.Self.Path & "\" & fontName) then 11 objFolder.CopyHere fontPath & fontName, &H4& 12 end if 13 end if 14 next