返回列表 发帖

[转贴] VBScript脚本复制图片到剪切板

imgpath="C:\BatHome.jpg" '在此位置输入你的图片绝对路径
temphtm="temp.html"
Set fso=CreateObject("scripting.filesystemobject")
Set fs=fso.CreateTextFile(temphtm)
fs.WriteLine "<Img Src='" & imgPath & "' id='TempImg'></img>"
fs.Close
Set fs=fso.GetFile(temphtm)
Set ie=CreateObject("internetexplorer.application")
ie.Navigate fs.path
ie.Visible=False
Do
WScript.Sleep 100
Loop Until ie.ReadyState=4
Set ctrl = ie.document.body.createControlRange
set oImg = ie.Document.getElementById("TempImg")
    oImg.contentEditable = true
    ctrl.add oImg
    ctrl.execCommand "Copy"
    oImg.contentEditable = false
    ie.Quit
fs.Delete
MsgBox "已经成功复制图片到剪切板"COPY
出自某VBS群

批处理、VBS剪贴板操作专题
http://www.bathome.net/thread-8329-1-1.html
mshta "javascript:moveTo(screen.width,0);document.write('<img id=\'x\' src=\'%f%\'>');i=document.body.createControlRange();i.add(x);i.execCommand('copy');close()"

我记得这个链接发过几次,某人没看过吗?

TOP

返回列表