CopyHere not working as expected when copying fonts

前端 未结 1 924
野性不改
野性不改 2021-01-27 17:01

I made a script, which is supposed to copy a bunch of fonts to the Windows font folder. When I run it, I receive the output of the file names I would like copied, but nothing co

相关标签:
1条回答
  • 2021-01-27 17:12

    Fonts need to be installed not copied. Copy the shell's objects rather than underlying files. The shell installs fonts copied into the fonts folder.

    Here's the objects you need adding files to a zip.

    Set objShell = CreateObject("Shell.Application")
    Set Ag=Wscript.Arguments
    set WshShell = WScript.CreateObject("WScript.Shell")
    
    Set SrcFldr=objShell.NameSpace(Ag(1))
    Set DestFldr=objShell.NameSpace(Ag(0))
    Set FldrItems=SrcFldr.Items
    DestFldr.CopyHere FldrItems, &H214
    Msgbox "Finished"
    
    0 讨论(0)
提交回复
热议问题