回复 2# flashercs
貌似没啥效果,win10 x64测试。
想添加直接发送enter键 居然也不生效。- 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)
- Set rxTTF = New RegExp
- rxTTF.IgnoreCase = True
- rxTTF.Pattern = "\.ttf|ttc|otf$"
- ' rxTTF.Pattern = "\.otf$"
- set WshShell = CreateObject("WScript.Shell")
- FOR EACH FontFile IN oSource.Items()
- IF rxTTF.Test(FontFile.Path) THEN
- WScript.Sleep 800
- oWinFonts.CopyHere FontFile.Path,16+256
- WScript.Sleep 800
- WshShell.AppActivate "安装字体"
- WshShell.SendKeys "{ENTER}"
- END IF
- WScript.Sleep 800
- WshShell.AppActivate "安装字体"
- WshShell.SendKeys "{ENTER}"
- NEXT
复制代码
|