| How to work with type library |
|---|
|
You can use the functions:LoadTypeLib and LoadRegTypeLib Adds a type library to the name space for the script. This is similar to the #include directive in C/C++. It allows a set of predefined items such as enumerated type, ... to be added to the run-time environment available to the script. Here's an example that uses constants from type library:// For JScript syntax: typelib.w_js // System.LoadTypeLib("C:\\my.tlb"); // Window.TextOut(1, 50, 30, " Monday " + Monday); // I can use the "Microsoft Scripting Runtime" type library System.LoadRegTypeLib("{420B2830-E718-11CF-893D-00A0C9054228}"); Window.TextOut(1, 50, 50, " CDRom " + CDRom); Window.UpdateWindow();
' For VBScript syntax: typelib.w_vbs
' System.LoadTypeLib("C:\\my.tlb")
' Window.TextOut 1, 50, 30, " Monday " & Monday
'I can use the "Microsoft Scripting Runtime" type library
System.LoadRegTypeLib("{420B2830-E718-11CF-893D-00A0C9054228}")
Window.TextOut 1, 50, 50, " CDRom " & CDRom
Window.UpdateWindow
You can make the type library.
|
| The advanced scripting shell. It is not wscript.exe! |