Use clipboard from VBScript

后端 未结 15 1470
青春惊慌失措
青春惊慌失措 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:24

    I devised another way to use IE and yet avoid security warnings...

    By the way.. this function is in JavaScript.. but u can easily convert it to VBScript..

    function CopyText(sTxt) {
        var oIe = WScript.CreateObject('InternetExplorer.Application');
        oIe.silent = true;
        oIe.Navigate('about:blank');
        while(oIe.ReadyState!=4) WScript.Sleep(20);
        while(oIe.document.readyState!='complete') WSript.Sleep(20);
        oIe.document.body.innerHTML = "";
        var oTb = oIe.document.getElementById('txtArea');
        oTb.value = sTxt;
        oTb.select();
        oTb = null;
        oIe.ExecWB(12,0);
        oIe.Quit();
        oIe = null;
    }
    

提交回复
热议问题