标题: [转贴] VBScript脚本复制图片到剪切板 [打印本页]
作者: find 时间: 2012-3-18 12:56 标题: 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 "已经成功复制图片到剪切板"
复制代码
出自某VBS群
作者: powerbat 时间: 2012-3-18 19:34
批处理、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()"
我记得这个链接发过几次,某人没看过吗?
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |