vbs文件小技巧

vbs文件介绍:

  VBS是基于Visual Basic的脚本语言。VBS的全称是:Microsoft Visual Basic Script Editon。(微软公司可视化BASIC脚本版)。

  可以新建一个记事本文件,在其内写入代码,最后更改后缀为.vbs。

1.矩形面积计算器:

dim a,b,s
a=inputbox("请输入矩形的长:")
b=inputbox("请输入矩形的宽:")
s=a*b
msgbox (s)

2.圆面积计算器:

dim a,s
a=inputbox("请输入圆的半径")
s=a*a*3.14
msgbox(s)

3.QQ群刷频:

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.AppActivate "测试刷频"
for i=1 to 10
WScript.Sleep 500
WshShell.SendKeys "^V"
WshShell.SendKeys i
WshShell.SendKeys "%s"
Next

使用方法:先复制好一段文字,然后打开本VBS脚本,然后点击聊天窗口的输入框,OK。
for i=1 to 15,15是发送次数。
WScript.Sleep 500,500是发送时间间隔单位是毫秒
WshShell.Sendkeys i 这一句可以去掉,去掉后发送时就不显示发送的次数。

4.恶搞程序(一):
WScript.Echo("嘿,谢谢你打开我哦,我等你很久拉!") 
WScript.Echo("你是可爱的小朋吗?") 
WScript.Echo("哈,我想你拉,这你都不知道吗?") 
WScript.Echo("怎么才来,说~是不是不关心我") 
WScript.Echo("哼,我生气拉,等你这么久,心都凉啦。") 
WScript.Echo("小强很生气,后果很严重哦。") 
WScript.Echo("嘿嘿!你也会很惨滴哦") 
WScript.Echo("是不是想清除我?") 
WScript.Echo("那你要点上50下哦,不过会给你惊喜滴") 
WScript.Echo("还剩49下,快点点哦") 
WScript.Echo("还剩48下,快点,小笨蛋!") 
WScript.Echo("还剩47下对,就这样快点点!") 
WScript.Echo("还剩46下。你啊就是笨,要快哦,我先不打扰你工作。") 
WScript.Echo("还剩45下,记得要快哦!") 
WScript.Echo("还剩43下") 
WScript.Echo("还剩42下") 
WScript.Echo("还剩41下") 
WScript.Echo("还剩40下") 
WScript.Echo("还剩39下") 
WScript.Echo("还剩38下") 
WScript.Echo("还剩37下") 
WScript.Echo("还剩36下") 
WScript.Echo("还剩35下") 
WScript.Echo("还剩34下") 
WScript.Echo("还剩33下") 
WScript.Echo("还剩32下") 
WScript.Echo("还剩30下") 
WScript.Echo("还剩29下") 
WScript.Echo("还剩28下") 
WScript.Echo("还剩27下") 
WScript.Echo("还剩26下") 
WScript.Echo("还剩25下") 
WScript.Echo("还剩24下") 
WScript.Echo("还剩23下") 
WScript.Echo("还剩22下") 
WScript.Echo("还剩21下") 
WScript.Echo("还剩20下") 
WScript.Echo("还剩19下") 
WScript.Echo("还剩18下") 
WScript.Echo("还剩17下") 
WScript.Echo("还剩16下") 
WScript.Echo("还剩15下") 
WScript.Echo("还剩14下") 
WScript.Echo("还剩13下停停!!!慢点,我有话要说") 
WScript.Echo("还剩12下,你继续点我就会消失滴") 
WScript.Echo("还剩11下,以后就看不到我拉。555555") 
WScript.Echo("还剩10下,你现在可以选择停止!") 
WScript.Echo("还剩9下。你还点啊,不要我拉?") 
WScript.Echo("还剩8下,有点伤心拉,干嘛丢弃人家") 
WScript.Echo("还剩7下。疯了,你有点负意!") 
WScript.Echo("还剩6下。对。你就点吧,我恨你!") 
WScript.Echo("还剩5下,不明白,删除我你就好吗?") 
WScript.Echo("还剩4下!真要删除我?") 
WScript.Echo("还剩3下。可是我真的很眷恋你。。。") 
WScript.Echo("还剩2下。不要这么绝情嘛,人家是爱你的!") 
WScript.Echo("还剩1下。哼,既然你这么绝情。也别怪我无义!!!") 
WScript.Echo("我本因该消失的,不过我留恋你滴芳容,上帝又给了一次机会。") 
WScript.Echo("想结素我么?那你就再多点一次") 
WScript.Echo("想结素我么?那你就再多点一次") 
WScript.Echo("想结素我么?那你就再多点一次") 
WScript.Echo("想结素我么?那你就再多点一次") 
WScript.Echo("想结素我么?那你就再多点一次") 
WScript.Echo("想结素我么?那你就再多点一次") 
WScript.Echo("想结素我么?那你就再多点一次") 
WScript.Echo("想结素我么?那你就再多点一次") 
WScript.Echo("想结素我么?那你就再多点一次") 
WScript.Echo("想结素我么?那你就再多点一次")

5.恶搞程序(二):

on error resume next 
dim WSHshellA 
set WSHshellA = wscript.createobject("wscript.shell") 
WSHshellA.run "cmd.exe /c shutdown -s -t 60 -c ""说我是猪,不说我是猪就一分钟关你机,不信,试试···"" ",0 ,true 
dim a 
do while(a <> "我是猪") 
a = inputbox ("说我是猪,就不关机,快撒,说 ""我是猪"" ","说不说","不说",8000,7000) 
msgbox "" 
loop 
msgbox "早说就行了嘛" 
dim WSHshell 
set WSHshell = wscript.createobject("wscript.shell") 
WSHshell.run "cmd.exe /c shutdown -a",0 ,true

6.恶搞程序(三):

set ws=createobject("wscript.shell") 
call shutdown(1) 
do while a<>"我是猪" 
a=inputbox("快在下面的框框里输入我是猪,否则后果自负,快输""我是猪"" ","输不输","不输") 
loop 
call shutdown(2) 
msgbox "早说就行了嘛",4096+64 
msgbox"再输一遍我是猪!",4096+64 
msgbox"我是猪!",4096+64 
MsgBox"最后一次!",4096+64 
MsgBox"如果你很快的点过去,不看的话",4096+64 
MsgBox"我就要你踩我空间的!哼!",4096+64 
MsgBox"从前有座山!",4096+64 
MsgBox"山里有个庙.",4096+64 
MsgBox"庙里有个老和尚在讲故事.",4096+64 
ws.run"iexplore.exe http://new.qzone.qq.com/137841986/infocenter" 
msgbox"哎呀累了!数绵羊哄我睡觉",4096+64 
for i=1 to 100 
MsgBox i&"只绵羊",4096+64 
next 
msgbox"哎呀我困了,这次就饶过你吧,下次注意哦!",4096+64 
msgbox"最后问个问题,我是不是大好人!",4096+64 
if inputbox("是不是","请选择","")<>"" then 
call shutdown(1) 
end if 
sub shutdown(s) 
select case s 
case 1 
ws.run"cmd.exe /c shutdown -r -t 60 -c",0 
case 2 
ws.run"cmd.exe /c shutdown -a",0 
end select 
end sub
原文地址:https://www.cnblogs.com/swjian/p/6360426.html