|
就是想做个字体安装器,把当前目录和子目录下的字体文件安装到FONT文件夹,字体格式有ttf、otf、ttc三种
已经有个例子 但是不能查找子目录 和其他两种格式 有没有大神可以修改一下!
-----------------------------------------------------------
Set ofso = CreateObject("Scripting.FileSystemObject")
SourceFolder = ofso.GetParentFolderName(Wscript.ScriptFullName)
Const FONTS = &H14&
Set objShell = CreateObject("Shell.Application")
Set oSource = objShell.Namespace(SourceFolder)
Set oWinFonts = objShell.Namespace(FONTS)
' Lame VBscript needs 4 f*ing lines instead of "if (/\.ttf$/i) " ...
Set rxTTF = New RegExp
rxTTF.IgnoreCase = True
rxTTF.Pattern = "\.ttf$"
FOR EACH FontFile IN oSource.Items()
IF rxTTF.Test(FontFile.Path) THEN
oWinFonts.CopyHere FontFile.Path
END IF
NEXT
-----------------------------------------------------------
|
|