vbs 中调用shell.application 简单函数
程序员文章站
2022-08-26 08:59:04
set os=createobject("wscript.shell") set os0=createobject("shell.application...
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
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
上一篇: ASP.NET表单验证方法详解第1/2页