vbs 中调用shell.application 简单函数
史蒂芬布雷克,2012年11月8日,徐志彪
set os=createobject("wscript.shell")
set os0=createobject("shell.application")
do
input1=inputbox(" 请选择:"+chr(13)+chr(13)+ _
"1. 全部窗口最小化"+chr(13)+ _
"2. 窗口状态复原"+chr(13)+ _
"3. 窗口均匀平铺"+chr(13)+ _
"4. 窗口纵向平铺"+chr(13)+ _
"5. 窗口重叠展开" +chr(13)+ _
"6. 资源管理器"+chr(13)+ _
"7. 设置系统时间" +chr(13) + _
"8. 刷新系统菜单" +chr(13)+ _
"9. 手动设置开始菜单"+chr(13)+ _
"10. 搜索文件"+chr(13)+ _
"11. 搜索计算机"+chr(13)+ _
"12. 运行"+chr(13)+ _
"13. 帮助"+chr(13)+ _
"14. 打开文件夹"+chr(13)+ _
"15. 挂起系统"+chr(13)+ _
"16. 关闭系统" +chr(13)+ _
"","vbs shell32 功能调用")
select case input1
case 1
os0.minimizeall
case 2
os0.undominimizeall
case 3
os0.tilehorizontally
case 4
os0.tilevertically
case 5
os0.cascadewindows
case 6
p1=os.specialfolders("desktop")
os0.explore(p1)
case 7
os0.settime
case 8
os0.refreshmenu
case 9
os0.trayproperties
case 10
os0.findfiles
case 11
os0.findcomputer
case 12
os0.filerun
case 13
os0.help
case 14
set path1=os0.browseforfolder(0,"选择要打开的文件夹:",0)
if path1 is nothing then
else
os0.open(path1.self.path)
end if
case 15
os0.suspend
case 16
os0.shutdownwindows
case ""
exit do
case else
os.popup "选择错误",2,"错误",64+0
end select
loop
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
用vbs实现文本循环读取
因为测试中需要读取一批url数据进行浏览,其实使用qtp本身的table能实现多种读取方式,但是因为需要tabel是使用excel保存的,在没有...
[阅读全文]
-
-
-
-
-
-
-
-
网友评论