WSH 9 : WScript ( WScript.exe), WshArguments, WshEnvironment, WshNetwork, WshShell, WshShortcut, WshSpecialFolders, WshUrlShortcut FileSystemObject.
WScript Windows Script Host. , .
WshArguments
WshEnvironment .
WshNetwork : , .
WshShell Windows, , ..
WshShortcut .
WshSpecialFolders Windows, , , ..
WshUrlShortcut , , WshShortcut.
FileSystemObject . WSH WScript, .
TextStream .
4 : WScript, WshShell, WshNetwork FileSystemObject. , , .
( WScript) . CreateObject, WScript.
, WshShell :
Set WshShell = CreateObject(WScript.Shell)
WScript
WScipt , .
Name :
WScript.Echo WScript.Name
FullName (CScript.exe WScript.exe) .
:
C:\WINDOWS\WSCRIPT.EXE
Path (CScript.exe WScript.exe).
Windows Windows, :
C:\WINDOWS
Version . , Version Windows Script Host, .
WScript.Echo WScript.Version
: (5.0 , 5.1), 5.0 Windows Scriptinh Host 1.0, 5.1. 2.0.
ScriptName .
Timeout
Timeout , .
WScript.Timeout = 5
WScript.Echo " 5 "
SrdErr, StdIn, StdOut - , - (CScript.exe).
|
|
Interactive
Interactive , (WScript.exe), . . false - , .. .
:
WScript.Interactive[ = True|False]
WScript
CreateObject ActiveX.
:
object.CreateObject(strProgID[,strPrefix])
object WScript.
StrProgID .
, WshShell
Set WshShell = WScript.CreateObject(WScript.Shell)
ConnectObject , .
DisconnectObject , ConnectObject.
GetObject , .
Echo . CScript.exe .
Sleep , ( ), .
Quit . .
Windows Scripting Host : ( Echo) ( Popup)
Echo
Echo WScript , WScript.exe, , CScript.exe, echo bat-.
:
object.Echo [[Arg1] [,Arg2] [,Arg3]... ]
object - WScript.
Arg1, Arg2, Arg3... ,
vbCrLf.
Wscript.Echo "", vbCrLf, ""
Wscript.Echo ""& vbCrLf& ""
Popup
Popup , Echo, , . Popup, WshShell, WshShell.
:
intButton = object.Popup(strText,[WaitSec],[strTitle],[natType])
object - WshShell
strText -
WaitSec - ( ),
strTitle - . , " ".
natType - .
OK | |
OK (Cancel) | |
(Abort), (Retry), (Ignore) | |
(Yes),(No), (Cancel) | |
(Yes) (No) | |
(Retry) (Cancel) |
:
popup intButton , .
:
OK | |
(Cancel) | |
(Abort) | |
(Retry) | |
(Ignore) | |
(Yes) | |
(No) |
|
|
popup .
Dim Interval, WshShell
' :
Interval = 5
' WshShell Popup:
Set WshShell = CreateObject("WScript.Shell")
WshShell.Popup " 5 ",Interval,_
" Popup", 48
VBScript, Windows Script Host : MsgBox ( ) InputBox ( ). , , VBA.