就是想做個字體安裝器,把當前目錄和子目錄下的字體檔案安裝到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
-----------------------------------------------------------
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/198932.html
標籤:vbScript
下一篇:#buttons { position: absolute; height: 10px; width: 100px; z-index: 2; bottom: 2
