• Windows script скрипт vbs Где я накосячил ?
    Dim oFSO, oApp, oFolderCopy, oShell
    Dim strFontsPath, strScriptPath
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    Set oShell = CreateObject("WScript.Shell")
    Set oApp = CreateObject("Shell.Application")
    WinDir = oShell.ExpandEnvironmentStrings ("%windir%")
    Const HKEY_LOCAL_MACHINE = &H80000002
    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
    strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
    Set oFolderCopy = oApp.Namespace("\\server\path_to_ront")
    If oFSO.FileExists(WinDir & "\Fonts\fontname.ttf") = True Then
    oFSO.DeleteFile WinDir & "\fonts\fontname.ttf",True
    strValueName = "FontName (TrueType)"
    oReg.DeleteValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName
    End If
    For Each oFont In oFolderCopy.Items
    oApp.Namespace(20).CopyHere oFont
    Next
    Set oFolderCopy = Nothing
    Set oApp = Nothing
    Set oShell = Nothing

    c:\PDFs\fonts.vbs(10, 1) (null): Неопознанная ошибка
    ♡ recommended by @folex

Replies (10)