複製鏈接
請複製以下鏈接發送給好友

wshshell

鎖定
Windows 是一種腳本宿主 ,WshShell 對象,提供對本地 Windows 外殼程序的訪問。
中文名
wshshell
屬    性
腳本宿主
提    供
對本地 Windows外殼程序的訪問
AppActivate
激活一個應用程序窗口
WshShell基礎介紹
屬性 説明
CurrentDirectory 返回或改變當前目錄。
Environment 返回 WshEnvironment 集合對象。
wshshell wshshell
SpecialFolders 使用 WshSpecialFolders 對象提供對 Windows shell 文件夾的訪問,如桌面文件夾,開始菜單文件夾和個人文檔文件夾。
方法 説明
AppActivate 激活一個應用程序窗口。
CreateShortcut 創建並返回 WshShortcut 對象。
Exec 在子命令窗口中運行一個應用程序,提供訪問StdIn/StdOut/StdErr流。
ExpandEnvironmentStrings 擴展 PROCESS 環境變量並返回結果字符串。
LogEvent 添加一個事件到日誌文件。
Popup 顯示包含指定消息的消息窗口。
RegDelete 從註冊表中刪除指定的鍵或值。
RegRead 從註冊表中返回指定的鍵或值。
RegWrite 在註冊表中設置指定的鍵或值。
Run 創建新的進程,該進程用指定的窗口樣式執行指定的命令。
SendKeys 發送一個或多個按鍵到活動窗口。
函數原型(VB寫法)
Function AppActivate(App, [Wait]) As Boolean
Function CreateShortcut(PathLink As String) As Object
Property CurrentDirectory As String
Property Environment([Type]) As WshEnvironment '只讀
Function Exec(Command As String) As WshExec
Function ExpandEnvironmentStrings(Src As String) As String
Function LogEvent(Type, Message As String, [Target As String]) As Boolean
Function Popup(Text As String, [SecondsToWait], [Title], [Type]) As Long
Sub RegDelete(Name As String)
Function RegRead(Name As String)
Sub RegWrite(Name As String, Value, [Type])
Function Run(Command As String, [WindowStyle], [WaitOnReturn]) As Long
Sub SendKeys(Keys As String, [Wait])
Property SpecialFolders As WshCollection '只讀
相關對象
WshCollection 對象 WshCollection 對象
WshCollection 對象
Function Count() As Long
Function Item(Index) '缺省
Property length As Long '只讀
WshEnvironment 對象
Function Count() As Long
Property Item(Name As String) As String '缺省
Property length As Long '只讀
Sub Remove(Name As String)
WshExec 對象
Property ExitCode As Long '只讀
Property ProcessID As Long '只讀
Property Status As WshExecStatus '只讀
Property StdErr As TextStream '只讀
Property StdIn As TextStream '只讀
Property StdOut As TextStream '只讀
Sub Terminate()
WshExecStatus 常數
Const WshFailed = 2
Const WshFinished = 1
Const WshRunning = 0
WshShortcut 對象
Property Arguments As String
Property Description As String
Property FullName As String '只讀 缺省
Property Hotkey As String
Property IconLocation As String
Property RelativePath As String
Sub Save()
Property TargetPath As String
Property WindowStyle As Long
Property WorkingDirectory As String
WshURLShortcut 對象
Property FullName As String '只讀 缺省
Sub Save()
Property TargetPath As String
WshWindowStyle 常數
Const WshHide = 0
Const WshMaximizedFocus = 3
Const WshMinimizedFocus = 2
Const WshMinimizedNoFocus = 6
Const WshNormalFocus = 1
Const WshNormalNoFocus = 4