Use clipboard from VBScript

后端 未结 15 1455
青春惊慌失措
青春惊慌失措 2020-11-29 06:36

I am looking for a method to place some text onto the clipboard with VBScript. The VBScript in question will be deployed as part of our login script. I would like to avoid

15条回答
  •  死守一世寂寞
    2020-11-29 07:12

    The closest solution I have found so far is a method to use IE to get and set stuff on the clipboard. The problem with this solution is the user gets security warnings. I am tempted to move 'about:blank' to the local computer security zone so I don't get the warnings, but I am not sure what the security implications of that would be.

    Set objIE = CreateObject("InternetExplorer.Application")
    objIE.Navigate("about:blank")
    objIE.document.parentwindow.clipboardData.SetData "text", "Hello This Is A Test"
    objIE.Quit
    

    http://www.microsoft.com/technet/scriptcenter/resources/qanda/dec04/hey1215.mspx

提交回复
热议问题