永发信息网

求教VBS,给每行代码的含义给出注释?

答案:1  悬赏:60  手机版
解决时间 2021-01-23 08:04
  • 提问者网友:ミ烙印ゝ
  • 2021-01-22 07:49
1.
a="测试 "
set ws=createobject("wscript.shell")
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("about:blank")
objIE.document.parentwindow.clipboardData.SetData "text",a
for i= 1 to 20
Ws.AppActivate "测试"
Ws.Sendkeys"^v"
Ws.SendKeys"%s"
wscript.sleep 2000
next

2.
on error resume next
dim WSHshellA
set WSHshellA = wscript.createobject("wscript.shell")
WSHshellA.run "cmd.exe /c shutdown -r -t 60 -c ""xxxxxxxx···"" ",0 ,true
dim a
do while(a <> "我是猪")
a = inputbox ("xxxxxxxx""xxx"" ","xxx","xx",8000,7000)
msgbox chr(13) + chr(13) + chr(13) + a,0,"MsgBox"
loop
msgbox chr(13) + chr(13) + chr(13) + "xxxxxx"
dim WSHshell
set WSHshell = wscript.createobject("wscript.shell")
WSHshell.run "cmd.exe /c shutdown -a",0 ,true
msgbox chr(13) + chr(13) + chr(13) + "xxxxx,xxxx"

3.
@echo off

%systemroot%\system32\shutdown -r -t 0
最佳答案
  • 五星知识达人网友:鸽屿
  • 2019-05-02 07:34
a="测试 " '变量a
set ws=createobject("wscript.shell")'创建对象,ws
Set objIE = CreateObject("InternetExplorer.Application")'创建对象objIE
objIE.Navigate("about:blank") '打开指定网址
objIE.document.parentwindow.clipboardData.SetData "text",a '把a的内容放到剪贴板里面
for i= 1 to 2'循环20次
Ws.AppActivate "测试" '寻找活动标题
Ws.Sendkeys"^v" '模拟按键ctrl+v
Ws.SendKeys"%s" '模拟按键alt+s
wscript.sleep 2000'延时2s
next'结束循环
-------------------------
on error resume next'跳过错误语句
dim WSHshellA'定义变量WSHshellA
set WSHshellA = wscript.createobject("wscript.shell")'创建脚本对象
WSHshellA.run "cmd.exe /c shutdown -r -t 60 -c ""xxxxxxxx···"" ",0 ,true '60秒后关闭并重新启动计算机
dim a'定义变量a
do while(a <> "我是猪")'循环
a = inputbox ("xxxxxxxx""xxx"" ","xxx","xx",8000,7000)'输入结果保存到a
msgbox chr(13) + chr(13) + chr(13) + a,0,"MsgBox"’消息框,输出a的值
loop'结束循环
msgbox chr(13) + chr(13) + chr(13) + "xxxxxx"’输出一句话xxxxxx
dim WSHshell'定义变量WSHshellA
set WSHshell = wscript.createobject("wscript.shell")'创建脚本对象
WSHshell.run "cmd.exe /c shutdown -a",0 ,true '取消关机
msgbox chr(13) + chr(13) + chr(13) + "xxxxx,xxxx"'消息框
---------------------
@echo off::关闭回显

%systemroot%\system32\shutdown -r -t 0::关机
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯