vbs實現(xiàn)的保存剪貼板中的文本并編輯或保存
來源:易賢網(wǎng) 閱讀:1528 次 日期:2014-08-12 12:00:07
溫馨提示:易賢網(wǎng)小編為您整理了“vbs實現(xiàn)的保存剪貼板中的文本并編輯或保存”,方便廣大網(wǎng)友查閱!

保存剪貼板中的文本.vbs

原理就是首先判斷是否存在同名文件,存在就名字后面+1,然后將剪貼板的內(nèi)容保存到自定義擴展名的文件里

代碼如下:

set fso=createobject("scripting.filesystemobject") : name=1

Dim na

na=Inputbox("請輸入拓展名:","拓展名","txt")

while fso.fileexists(name&"."&na)=true

name=name+1

wend

set o=fso.opentextfile(name&"."&na,2,true)

set hf=Createobject("htmlfile")

wind=hf.parentwindow.clipboarddata.getdata("text")

o.writeline wind : o.close

保存剪貼板中的文本并編輯.vbs

代碼如下:

set fso=createobject("scripting.filesystemobject") : name=1

Dim na

na=Inputbox("請輸入拓展名:","拓展名","txt")

while fso.fileexists(name&"."&na)=true

name=name+1

wend

set o=fso.opentextfile(name&"."&na,2,true)

set hf=Createobject("htmlfile")

wind=hf.parentwindow.clipboarddata.getdata("text")

o.writeline wind : o.close

createobject("wscript.shell").exec "notepad.exe "&name&"."&na&""

更多信息請查看IT技術(shù)專欄

更多信息請查看腳本欄目
易賢網(wǎng)手機網(wǎng)站地址:vbs實現(xiàn)的保存剪貼板中的文本并編輯或保存
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點

版權(quán)所有:易賢網(wǎng)