![]() ![]() ![]() ![]() |
| Topics this page:
|
Related Topics:
|
|
|
Logon files (introduced with WSH 2) are read by Windows 2000 PDC's and BDC's integrated with the Windows 2000 OS.
Commands within .wsh files may access system services through requests for COM components to be implemented (what interface handlers to use).
Sample .wsh logon script
The MS.NET (5.6) version of JScript developed in conjunction with ECMAScript Edition 4 includes access to the .NET Frameworks as well as code compilation, typed and typeless variables, classes (with inheritance, function overloading, property accessors, etc.), packages, and cross-language support.
JScript Language Reference (from the Windows 2000 Professional CD.
folder VALUADD/ MSFT/ XTRADOCS)
But unlike VBA, VBScript v5 supports run-time Regular Expression (RegExp), Eval of assignment expressions and and Evaluate on comparison expressions that tests whethre variables have the same value.
VBScript Language Reference (from the Windows 2000 Professional CD
folder VALUADD/ MSFT/ XTRADOCS)
Run sample VBScript file
viewall.vbs
(a compilation of .vbs files from the Windows 2000 Resource Kit CD)
COM requests are dispatched by the Scrobj.dll run-time component (COM inproc server). Compiled Interface handler components implement specific COM interfaces, such as DHTML Behaviors. Thus, the complexities of COM, including the implementation of such COM-standard interfaces as IUnknown, are embedded in the various interface handlers.
XML elements in .wsc files may <reference> “type libraries” containing pre-built COM components.
Introducing Windows Script Components (from the Windows 2000 Professional CD
folder VALUADD/ MSFT/ XTRADOCS)
|
TABLE 1: WSH Counterparts to Batch File Commands | ||
Logon Script Task |
Batch File Solution | WSH Solution |
Determining directory and disk space utilization | Resource kit utilities diruse.exe and diskuse.exe | VBScript's FileSystemObject |
Performing file I/O | Command redirection symbols(e.g., >, >>, <, |) and command filters (e.g., find, more, sort) | VBScript's FileSystemObject |
Using environment variables | Command processor's Set command and %EnvironmentVariable% construct | WSH Shell object's Environment property |
Handling errors | ERRORLEVEL environment variable | VBScript's Err object |
Accepting user input | Command-line arguments the script accesses via %1, %2, %3, etc. | Command-line arguments the script accesses via WScript's Arguments property, or arguments the user enters interactively and the script accesses via VBScript's InputBox function |
Providing script output | Command processor's Echo command | WScript's Echo method, WSH Shell object's Popup method, or VBScript's MsgBox function |
Establishing network connections | NT's net.exe commands | WSH Network object |
Performing Registry I/O | Resource kit utility reg.exe | WSH Shell object's RegDelete, RegRead, and RegWrite methods |
Running external commands | Command or utility name | WSH Shell object's Run method |
Searching via regular expressions | Command redirection symbols (e.g., <, |) and command filters (e.g., find, findstr) | Forthcoming VBScript RegExp object |
Manipulating groups and users | NT's net.exe commands and a variety of resource kit and third-party utilities | ADSI |
| ![]() ![]() ![]() |
| ![]() ![]() ![]() |
| ![]()
Brent Lane's "TNQ300-12 How To Administer Windows 2000 Using Windows Script Host 2.0 (Part A and B)"
on the TechNet Training CD 12.
Code samples are from
| ![]() ![]() ![]() |
VBScript provides for a more sophisticated dialog box:
|
buttons | result | ||||||
---|---|---|---|---|---|---|---|
1 vbOK |
3 vbAbort |
4 vbRetry |
5 vbIgnore |
6 vbYes |
7 vbNo |
2 vbCancel |
|
0 or vbOKOnly | OK | ||||||
1 or vbOKCancel | OK | Cancel | |||||
2 or vbAbortRetryIgnore | Abort | Retry | Ignore | ||||
3 or vbYesNoCancel | Yes | No | Cancel | ||||
4 or vbYesNo | Yes | No | |||||
5 or vbRetryCancel | Retry | Cancel | |||||
16 or vbCritical | Stop icon. | ||||||
32 or vbQuestion | Question mark icon. | ||||||
48 or vbExclaimation | Exclaimation point icon. | ||||||
64 or vbInfomation | Infomation icon. | ||||||
256 or vbDefaultButton2 | Sets the focus to the second button. | ||||||
512 or vbDefaultButton3 | Sets the focus to the third button. | ||||||
4096 or vbSystemModal | Presents the dialog box in the foreground. |
VBScript Syntax: | ![]() ![]() ![]() |
| ![]() ![]() ![]() |
| ![]() ![]() ![]() |
| ![]() ![]() ![]() |
| ![]() ![]() ![]() |
![]()
| Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page ![]() Thank you! |