谁能把这个改一下,把“XXX字体已安装。你希望替换它吗?”改成直接替换,不提示。
源代码地址- 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
复制代码
|