VBS基础

相对路径  Wscript.Echo Left(WScript.ScriptFullName,InStrRev(WScript.ScriptFullName,"\"))

显示桌面  CreateObject("Shell.Application").ToggleDesktop

加入注册表  Wscript.CreateObject("WScript.Shell").RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Run\test", """world""" 

用WMI来ping 

Set objPing = GetObject("winmgmts:").Get("Win32_PingStatus.Address='baidu.com'")
Wscript.Echo objPing.StatusCode

 

posted @ 2013-09-02 09:19  cnsealine  阅读(219)  评论(0编辑  收藏  举报