我对脚本很新。我必须为超过100台计算机部署字体。我在https://www.geekshangout.com/vbs-script-to-install-a-font/处设置了一个脚本字体,它可以在没有字体的机器上正常工作。但如果有字体,它会提示按YES / NO来替换字体。我正在尝试部署18种字体。我有任何方法可以在没有提示的情况下替换现有字体,或者只是自动将其作为输入。 我发现的脚本是
`Option Explicit
Dim objShell, objFSO, wshShell
Dim strFontSourcePath, objFolder, objFont, objNameSpace, objFile
Set objShell = CreateObject("Shell.Application")
Set wshShell = CreateObject("WScript.Shell")
Set objFSO = createobject("Scripting.Filesystemobject")
strFontSourcePath = "\\it\Deployments\(Dell setup)\Office fonts\FILES\Maison Neue MG [DESK]"
If objFSO.FolderExists(strFontSourcePath) Then
Set objNameSpace = objShell.Namespace(strFontSourcePath)
Set objFolder = objFSO.getFolder(strFontSourcePath)
For Each objFile In objFolder.files
If LCase(right(objFile,4)) = ".ttf" OR LCase(right(objFile,4)) = ".otf" Then
If objFSO.FileExists(wshShell.SpecialFolders("Fonts") & objFile.Name) = False Then
Set objFont = objNameSpace.ParseName(objFile.Name)
objFont.InvokeVerb("Install")
Set objFont = Nothing
End If
End If
Next
Else
Wscript.Echo "Path not found"
End If
Wscript.Echo "Installation Complete :)"`