文档下载 文档下载导航
设为首页 | 加入收藏
搜索 请输入内容:  
 导航当前位置: 文档下载 > 所有分类 > IT/计算机 > Windows脚本编程核心技术精解-随书示例脚本-第十八章
侵权投诉

Windows脚本编程核心技术精解-随书示例脚本-第十八章

随书示例脚本 Windows脚本编程核心技术精解 [美]Tobias Weltner著 本书以学习脚本语言的进程为主线,主要讲述了脚本对象、文件系统、软件控制、访问操作系统和系统隐藏部件的应用五大模块。主要内容有:脚本开发、对象调用、系统对话框调用、文件系统访问、其他程序的调用进程控制、注册表操作、系统信息处理、事件操作、网络通信、打印机等外设的使用、图标摘录、多媒体控制、数据库应用和服务器管理等。

' 18-2.VBS

'---the following lines have been added to ensure all required COM objects are available on your system.

' script uses the following components:

' wscript.shell

CheckCOM

'---end of COM-object checking code---

' which engine runs this script?

engine = lcase(mid(WScript.FullName, InstrRev(WScript.FullName,"\")+1))

if not engine="cscript.exe" then

' re-launch script using cscript.exe

set wshshell = CreateObject("WScript.Shell")

wshshell.run "CSCRIPT.EXE """ & WScript.ScriptFullName & """"

WScript.Quit

end if

MsgBox "I run as DOS-Box!"

' --- the following code had been automatically added to ensure all required COM objects are installed.

function COMExists(name)

' checks whether a specific COM object is installed on

' your local machine

set cwsh = CreateObject("WScript.Shell")

on error resume next

dummy = cwsh.RegRead("HKCR\" & name & "\")

if err.number<>0 then

COMExists = false

else

COMExists = true

end if

end function

sub CheckCOM

if not COMExists("wscript.shell") then

msg="COM-Object ""wscript.shell"" is required. This object is currently not installed on your system." & vbCr

msg = msg & "Reinstall the Windows Scripting Host!" & vbCr

上一页第3页

你可能喜欢

  • windows内存管理技术
  • windows程序编程
  • windows+xp优化
  • windows7虚拟wifi教程
  • windows8界面图片
  • windows消息
  • windows脚本编程
  • windows技巧

热门文档

相关文档

站点地图 | 文档上传 | 侵权投诉 | 手机版
本站所有资源均来自互联网,本站只负责收集和整理,均不承担任何法律责任,如有侵权等其它行为请联系我们.
文档下载 Copyright 2013 doc.guandang.net All Rights Reserved.  -  email