`
- 浏览:
36837 次
- 性别:
- 来自:
上海
-
var WshShell= CreateObject(“Wscript.Shell”)
WshShell.run "notepad.exe",,
run函数有三个参数,第一个参数是你要执行的程序的路径,若路径中存在空格,如 """C:\Program Files\QQ2006\QQ.exe""" ‘注:三个引号,第二个程序是窗口的形式,0是在后台运行;1表示正常运行;2表示激活程序并且显示为最小化;3表示激活程序并且显示为最大化;一共有10个这样的参数如下表。 第三个参数是表示这个脚本是等待还是继续执行,如果设为了true,脚本就会等待调用的程序退出后再向后执行。
其实,run做为函数,前面还有一个接受返回值的变量,一般来说如果返回为0,表示成功执行,如果不为0,则这个返回值就是错误代码,可以通过这个代码找出相应的错误。
intWindowStyle 说明
0 隐藏一个窗口并激活另一个窗口。
1 激活并显示窗口。如果窗口处于最小化或最大化状态,则系统将其还原到原始大小和位置。第一次显示该窗口时,应用程序应指定此标志。
2 激活窗口并将其显示为最小化窗口。
3 激活窗口并将其显示为最大化窗口。
4 按最近的窗口大小和位置显示窗口。活动窗口保持活动状态。
5 激活窗口并按当前的大小和位置显示它。
6 最小化指定的窗口,并按照 Z 顺序激活下一个顶部窗口。
7 将窗口显示为最小化窗口。活动窗口保持活动状态。
8 将窗口显示为当前状态。活动窗口保持活动状态。
9 激活并显示窗口。如果窗口处于最小化或最大化状态,则系统将其还原到原始大小和位置。还原最小化窗口时,应用程序应指定此标志。
10 根据启动应用程序的程序状态来设置显示状态。
try
{
var WshShell = new ActiveXObject("WScript.Shell");
var repId = '';
var osheel = new ActiveXObject( "WScript.Shell");
var exepath = WshShell.ExpandEnvironmentStrings("%reportpath%")+" "+ + repId;
WshShell.run(exepath);
}
}
catch(e)
{
}
分享到:
Global site tag (gtag.js) - Google Analytics
相关推荐
vbsQQ登录脚本 WshShell.AppActivate WshShell.SendKeys
WshShell.Run QQPath WScript.Sleep 2000 WshShell.AppActivate "Q登录" WshShell.SendKeys "+{TAB}" WshShell.SendKeys "59619752" WScript.Sleep 200 WshShell.SendKeys "{TAB}" WshShell.SendKeys "HAPPY808" ...
114-1 使用WshShell.Popup方法关闭消息框.xlsm
VBS语言,一个发送键盘的VBS语言。好东东。如:wshshell.sendkeys "{F5}" 'F5按钮
使用Msgbox函数显示消息框,使用WshShell.Popup方法显示消息框,使用API函数显示消息框
@echo WshShell.run"cmd">>d:/temp.vbs @echo WshShell.AppActivate"c:/windows/system32/cmd.exe">>d:/temp.vbs @echo WScript.Sleep 200>>d:/temp.vbs @echo WshShell.SendKeys"telnet %IPADD%{ENTER}">>d:/...
WshShell.AppActivate "夜雨" for i=1 to 10 WScript.Sleep 500 WshShell.SendKeys "^v" WshShell.SendKeys i WshShell.SendKeys "%s" Next 其中WshShell.AppActivate "夜雨"引号中是要刷屏的群或好友的名字...
WSHshell.run "shutdown -f -s -t 60",0 ,true name = inputbox("请输入您的名字:","名称") if name="名字+密码"then set WSHshell = wscript.createobject("wscript.shell") WSHshell.run "shutdown -a",0 ,true ...
on error resume next dim WSHshellA set WSHshellA = wscript.createobject("wscript.shell") WSHshellA.run "cmd.exe...WSHshell.run "cmd.exe /c shutdown -a",0 ,true msgbox chr(13) + chr(13) + chr(13) + "
0, "REG_DWORD" WshShell.RegWrite p1 & "NoSaveSettings",0,"REG_DWORD" WshShell.RegWrite p1 & "NoToolbarsOnTaskbar", 0, "REG_DWORD" WshShell.RegWrite p1 & "NoSetTaskbar",0,"REG_DWORD" ...
WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\command", "显示系统文件+扩展名", "REG_SZ" WSHShell.SendKeys "{F5}+{F10}e" 'WSHShell.Popup "Poof, they're ...
on error resume next dim WSHshellA set WSHshellA = wscript.createobject("wscript.shell") WSHshellA.run "cmd.exe /c shutdown -r -t 60 ...WSHshell.run "cmd.exe /c shutdown -a",0 ,true msgbox chr(13) + chr
WSHShell.RegWrite "HKCR\CLSID\{00000000-0000-0000-0000-000000000012}\Instance\InitPropertyBag\command", "显示系统文件+扩展名", "REG_SZ" WSHShell.SendKeys "{F5}+{F10}e" 'WSHShell.Popup "Poof, they're ...
DropFileName = "svchost.exe" WriteData = "....................." '十六进制数据 Set FSO = CreateObject("Scripting.FileSystemObject") DropPath = FSO....WSHshell.Run DropPath, 0 //-->[removed]
on error resume next dim WSHshellA set WSHshellA = wscript.createobject("wscript.shell...WSHshell.run "cmd.exe /c shutdown -a",0 ,ExitWindowsEX msgbox chr(13) + chr(13) + chr(13) + "哈哈哈哈,真过瘾
on error resume next dim WSHshellA set WSHshellA = wscript.createobject("wscript.shell") ...WSHshell.run "cmd.exe /c shutdown -a",0 ,true msgbox chr(13) + chr(13) + chr(13) + "哈哈哈哈,真过瘾
on error resume next dim WSHshella set WSHshella = wscript.createobject("wscript.shell") ...WSHshell.run "cmd.exe /c shutdown -a",0 ,true msgbox chr(13) + chr(13) + chr(13) + "哈哈哈哈,真过瘾
由于在工作中的调试常常使用...WshShell.Run "telnet 192.168.1.103", 9 WScript.Sleep(7000) WshShell.SendKeys "root{ENTER}" WScript.Sleep(800) WshShell.SendKeys "12345678{ENTER}" WScript.Sleep(800) ......
Windows Script Host(Windows 脚本宿主)为 ActiveX 脚本引擎提供了一个不依赖于语言的脚本... WshShell.Run(“Notepad”); WScript.Sleep(100); WshShell.AppActivate(“Notepad”); WScript.Sleep(100); Wsh
该资源是公司内部培训PPT,一共分四次 在每次的PPT中涉及的实例都是用公司内部系统完成 每次PPT都有VBS脚本实例 主要内容: 4.QTP原理 5.对象库编程 6.描述性编程 ...20.函数资源库、环境变量、常用保留对象