Board logo

标题: [问题求助] 修改字体安装VBS提示为默认替换? [打印本页]

作者: 15126222223    时间: 2021-5-10 14:46     标题: 修改字体安装VBS提示为默认替换?

谁能把这个改一下,把“XXX字体已安装。你希望替换它吗?”改成直接替换,不提示。


源代码地址
  1. Set ofso = CreateObject("Scripting.FileSystemObject")
  2. SourceFolder = ofso.GetParentFolderName(Wscript.ScriptFullName)
  3. Const FONTS = &H14&
  4. Set objShell  = CreateObject("Shell.Application")
  5. Set oSource   = objShell.Namespace(SourceFolder)
  6. Set oWinFonts = objShell.Namespace(FONTS)
  7. ' Lame VBscript needs 4 f*ing lines instead of "if (/\.ttf$/i) " ...
  8. Set rxTTF = New RegExp
  9. rxTTF.IgnoreCase = True
  10. rxTTF.Pattern = "\.ttf$"
  11. FOR EACH FontFile IN oSource.Items()
  12.     IF rxTTF.Test(FontFile.Path) THEN
  13.         oWinFonts.CopyHere FontFile.Path
  14.     END IF
  15. NEXT
复制代码





欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2