home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / zkuste / Perl / ActivePerl-5.6.0.613.msi / 䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥 / _b568deaa9903daa55461a86af96592f5 < prev    next >
Text File  |  2000-03-22  |  22KB  |  506 lines

  1. <HTML>
  2.  
  3. <HEAD>
  4. <TITLE>Rough Guide to Windows Script Host</TITLE>
  5. <LINK rel="stylesheet" href="../Active.css" type="text/css">
  6. <LINK rev="made" href="mailto:">
  7. <META name="GENERATOR" content="Microsoft FrontPage 4.0">
  8. <META name="ProgId" content="FrontPage.Editor.Document">
  9. </HEAD>
  10.  
  11. <BODY>
  12.  
  13. <TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
  14.   <TR>
  15.     <TD class="block" valign="MIDDLE" width="100%" bgcolor="#cccccc"><STRONG>
  16.       <P class="block"> Rough Guide to Windows Script Host</P>
  17.       </STRONG></TD>
  18.   </TR>
  19. </TABLE>
  20. <A name="__index__"></A>
  21. <UL>
  22.   <LI><A href="#introduction">Windows Script Host (WSH)</A>
  23.     <UL>
  24.       <LI><A href="#executing">Running a WSH File</A>
  25.       <LI><A href="#objectmodel">The Object Model</A>
  26.         <UL>
  27.           <LI><A href="#wscript">The Windows Script Object</A>
  28.           <LI><A href="#wshshell">The WshShell Object</A>
  29.             <UL>
  30.               <LI><A href="#shortcut">Creating Shortcuts</A>
  31.               <LI><A href="#specialfolder">Special Folders</A>
  32.               <LI><A href="#registry">working with The Registry</A>
  33.               <LI><A href="#misc">Miscellanous</A>
  34.             </UL>
  35.           <LI><A href="#network">The WshNetwork Object</A>
  36.         </UL>
  37.       <LI><A href="#elementref">XML Element Referece</A>
  38.         <UL>
  39.           <LI><A href="#elemjob"><job></A>
  40.           <LI><A href="#elemscr"><script></A>
  41.           <LI><A href="#elemres"><resource></A>
  42.           <LI><A href="#elemref"><reference></A>
  43.         </UL>
  44.     </UL>
  45.   </LI>
  46.   <LI><A href="#author and copyright">AUTHOR AND COPYRIGHT</A>
  47. </UL>
  48. <P><A name="introduction">
  49. <HR>
  50. <H1>Windows Script Host (ASP)</H1>
  51. Windows Script Host (WSH) is a scripting host for ActiveX Scripting Engines such as PerlScript. As a
  52. host, WSH enables you to use the scripting language from the command-line and from within the
  53. Windows desktop with the WSH features.<BR>
  54. <BR>
  55. </A><A name="executing">
  56. <H2>Running a WSH File</H2>
  57. In order to execute a WSH-file, use one of two executable files depending on your needs: WScript.exe
  58. for Windows desktop files and CScript.exe is for command-line scripts. You can set the behavior and
  59. appearance of these executed scripts by running the executable without providing a file; if so,
  60. WScript will display a properties page that you can modify, and CScript will show the available
  61. switches. At work, WSH enables you to use more than one scripting engine in the same file, include
  62. typelibraries, and run more than a single job from one file to name a few.<BR>
  63. <BR>
  64. </A><A name="objectmodel">
  65. <H2>The Object Model</H2>
  66. Implemented as an object-model, WSH provides a simple interface for its tasks. As you author, the
  67. WSH file uses XML as its markup for separating the elements. Let's look at a simple wSH file that
  68. prints "Hello World!".
  69. <UL>
  70.   <CODE><Job ID="HelloWorld"><BR>
  71.   <script language=PerlScript><BR>
  72.   $WScript->Echo("Hello World!");<BR>
  73.   </script><BR>
  74.   </Job></CODE>
  75. </UL>
  76. The XML Job-elements encloses the ID of the Job that is run, and the script elements define
  77. PerlScript as the script language to use. You will experience different results depending if you
  78. execute this from the command-line or from the windows desktop. The first instance will print text
  79. to the screen, but the Windows desktop will pop up a messagebox with "Hello World!" Next,
  80. let's look at what the WScript object has to offer.<BR>
  81. <BR>
  82. </A><A name="wscript">
  83. <H2>The Windows Script Object</H2>
  84. The WScript object is a built-in object; therefore, you do not need to create a specific instance of
  85. it within your WSH. On the contrary, the object in place is used to create instances of most other
  86. objects exposed through the wSH programming interface.<BR>
  87. <BR>
  88. The <CODE>CreateObject</CODE> method will create an instance of a given object. In the following
  89. example, we'll see how an ADO Connection object is easily created within WSH.
  90. <UL>
  91.   <CODE><Job ID="Test"><BR>
  92.   <script language=PerlScript><BR>
  93.   $conn=$WScript->CreateObject('ADODB.Connection');<BR>
  94.   $conn->Open(<<EOF);<BR>
  95.   Provider=SQLOLEDB;<BR>
  96.   User ID=sa;<BR>
  97.   Catalog=Northwind;<BR>
  98.   EOF<BR>
  99.   <BR>
  100.   if($conn->{State} == 1) {<BR>
  101.   $WScript->Echo("Connection Successful!")<BR>
  102.   }<BR>
  103.   else {<BR>
  104.   $WScript->Echo("Connection Failed ...");<BR>
  105.   }<BR>
  106.   </script><BR>
  107.   </Job></CODE>
  108. </UL>
  109. In addition to the above, you can specify a second parameter in the call to <CODE>CreateObject</CODE>.
  110. This parameter contains a string which defines a prefix that you specify. By doing so, the object's
  111. outgoing interface is connected and any time an event is fired from the object, you can intercept it
  112. within the WSH file. For example, in the ADO connection object, there are a number of events.
  113. Sparing the details, <CODE>WillConnect</CODE> is called before a connection starts, and <CODE>Connectcomplete</CODE>
  114. is called after a connection has been started. They can be easily intercepted within the wSH file.
  115. <UL>
  116.   <CODE><Job ID="Test"><BR>
  117.   <script language=PerlScript><BR>
  118.   $conn=$WScript->CreateObject('ADODB.Connection', 'MyWSH_');<BR>
  119.   $conn->Open(<<EOF);<BR>
  120.   Provider=SQLOLEDB;<BR>
  121.   User ID=sa;<BR>
  122.   Catalog=Northwind;<BR>
  123.   EOF<BR>
  124.   <BR>
  125.   if($conn->{State} == 1) {<BR>
  126.   $WScript->Echo("Connection Successful!")<BR>
  127.   }<BR>
  128.   else {<BR>
  129.   $WScript->Echo("Connection Failed ...");<BR>
  130.   }<BR>
  131.   <BR>
  132.   sub MyWSH_ConnectComplete {<BR>
  133.   $WScript->Echo("ConnectComplete was fired ... ");<BR>
  134.   }<BR>
  135.   <BR>
  136.   sub MyWSH_WillConnect {<BR>
  137.   $WScript->Echo("WillConnect was fired ... ");<BR>
  138.   }<BR>
  139.   </script><BR>
  140.   </Job></CODE>
  141. </UL>
  142. For the same result as above, you can use the <CODE>ConnectObject</CODE>-method whose syntax is <CODE>$WScript->ConnectObject(Object,
  143. Prefix);</CODE>. The method <CODE>$WScript->DisconnectObject(Object);</CODE> will disconnect its
  144. event handling provided that the object is connected. Some other methods are as follows: <CODE>$Wscript->Echo(1,
  145. 2, 3, n);</CODE> Print text to the standard output defined by wSH. Separating the arguments cause
  146. only a space to separate the items in a desktop environment and a newline to separate the items in a
  147. command-line scenario.<BR>
  148. <BR>
  149. <CODE>$WScript->GetObject(Pathname [,ProgID], [Prefix]);</CODE> Retrieves an Automation object
  150. from a file or an object specified by the strProgID parameter.<BR>
  151. <BR>
  152. <CODE>$WScript->Quit([$int_errorcode]);</CODE> Quit and process and optionally provide an integer
  153. which represents an error code.<BR>
  154. <BR>
  155. <CODE>Sleep: $WScript->Sleep($int_milliseconds);</CODE> Places the script process into an
  156. inactive state for the number of milliseconds specified and then continues execution.<BR>
  157. <BR>
  158. And its properties are: <CODE>Application: $WScript->{Application};</CODE> Provides the IDispatch
  159. interface on the WScript object<BR>
  160. <BR>
  161. <CODE>Arguments: $WScript->{Arguments};</CODE> Returns a pointer to the WshArguments collection
  162. or identifies arguments for the shortcut to the collection.<BR>
  163. <BR>
  164. <CODE>Fullname: $WScript->{Fullname};</CODE> Returns a string containing the full path to the
  165. host executable file or shortcut object.<BR>
  166. <BR>
  167. <CODE>Name: $WScript->{Name};</CODE> Returns a string containing the friendly name of the WScript
  168. object.<BR>
  169. <BR>
  170. <CODE>Path: $WScript->{Path};</CODE> Provides a string containing the name of the directory where
  171. WScript.exe or CScript.exe resides.<BR>
  172. <BR>
  173. <CODE>ScriptFullname: $WScript->{Scriptfullname};</CODE> Provides the full path to the script
  174. currently being run.<BR>
  175. <BR>
  176. <CODE>ScriptName: $WScript->{Scriptname};</CODE> Provides the file name of the script currently
  177. being run.<BR>
  178. <BR>
  179. <CODE>StdError: $WScript->{StdError};</CODE> Exposes the write-only error output stream for the
  180. current script. Only applicable with CScript command-line WSH files.<BR>
  181. <BR>
  182. <CODE>StdIb: $WScript->{StdIn};</CODE> Exposes the read-only input stream for the current script.
  183. CScript only.<BR>
  184. <BR>
  185. <CODE>StdOut: $WScript->{StdOut};</CODE> Exposes the write-only output stream for the current
  186. script. CScript only.<BR>
  187. <BR>
  188. <CODE>Version: $WScript->{Version};</CODE> Returns the version of Microsoft Windows Script Host.<BR>
  189. <BR>
  190. On a final note, if you are using Cscript.exe and passing arguments to the file, you can read the
  191. arguments as follows:
  192. <UL>
  193.   <CODE><Job ID="args"><BR>
  194.   <script language=PerlScript><BR>
  195.   $arg = $WScript->{Arguments};<BR>
  196.   <BR>
  197.   $countArgs = $arg->{Count};<BR>
  198.   <BR>
  199.   for($i=0; $i<$countArgs; $i++) {<BR>
  200.   $WScript->Echo($arg->Item($i));<BR>
  201.   }<BR>
  202.   </script><BR>
  203.   </job></CODE>
  204. </UL>
  205. </A><A name="wshshell">
  206. <H2>The WShShell Object</H2>
  207. The WshShell object must be instantiated by the WScript object.
  208. <UL>
  209.   <CODE>$WshShell = $WScript->CreateObject("WScript.Shell")</CODE>
  210. </UL>
  211. An interesting method of the WshShell object is the ability to activate an application window and
  212. putting it in focus. This is done by calling AppActivate either with the title in the title bar of
  213. the running application window as a parameter or by using the task ID as a parameter.
  214. <UL>
  215.   <CODE><Job Id="WshShell"><BR>
  216.   <script language=PerlScript><BR>
  217.   $WshShell = $WScript->CreateObject("WScript.Shell");<BR>
  218.   $WshShell->Run("notepad");<BR>
  219.   $WshShell->AppActivate("Untitled - Notepad");<BR>
  220.   <BR>
  221.   my($message) = "Hello from PerlScript!\n";<BR>
  222.   <BR>
  223.   for($i=0; $i<length($message); $i++) {<BR>
  224.   $char = substr($message, $i, 1);<BR>
  225.   $WScript->Sleep(100);<BR>
  226.   $WshShell->SendKeys($char);<BR>
  227.   }<BR>
  228.   </script><BR>
  229.   </job></CODE>
  230. </UL>
  231. The <CODE>SendKeys</CODE>-method simply sends keystrokes to the active windows. The <CODE>Run</CODE>
  232. method is a little more flexible.
  233. <UL>
  234.   <CODE>$WshShell->Run(Command, [WindowStyle], [WaitOnReturn]);</CODE>
  235. </UL>
  236. The WindowStyle can be an integer between 0 through 10, and WaitOnReturn is a boolean value or 1
  237. (TRUE) or 0 (FALSE). FALSE is the default value it means that an immeditate return to script
  238. execution contrary to waiting for the process to end is preferable. It also returns an error code of
  239. zero while TRUE returns any error code generated by the active application.</A><A name="shortcut">
  240. <H3>Creating Shortcuts</H3>
  241. In addition, you can create shortcuts. Either you create a dekstop shortcut or a URL shortcul. The
  242. method call <CODE>CreateShortcut($path_or_url)</CODE> returns an object reference to a <CODE>WshShortcut</CODE>-object.
  243. Keep in mind that a dekstop shortcut has tbe extension .lnk and an URL shortcul has the file
  244. extension .url. In the latter case, a WshURLShortcut object is returned.<BR>
  245. <BR>
  246. With the WshShortcut-object, one method exists, so it is mainly properties regarding the shortcut
  247. that you need to set. The <CODE>Description</CODE>-property contains a string describing the
  248. shortcut, <CODE>Fullname</CODE> returns the full path to the host executable, <CODE>Hotkey</CODE>
  249. allows for combinations such as "ALT+CTRL+X" as hotkeys for shortcuts on the Windows
  250. dekstop or windows startmenu, <CODE>IconLocation</CODE> is a property that you set to "Path,
  251. index" to provide the Icon location of the shortcut. In addition, use the <CODE>TargetPath</CODE>-property
  252. to set the path to the executable file pointed to by the shortcut, <CODE>WindowStyle</CODE> can be
  253. set to either 1, 3, or 7 for the shortcut object, and <CODE>WorkingDirectory</CODE> defines the
  254. directory in which the shortcut should start. If you are shortcutting a URL, you have only the <CODE>Fullname</CODE>
  255. and <CODE>TargetPath</CODE> properties where the latter one is a URL. All shortcut objects are final
  256. when you call the <CODE>Save</CODE> method.</A><A name="specialfolder">
  257. <H3>Special Folders</H3>
  258. The WshShell object can also return a WshSpecialFolders object which contains paths to shell folders
  259. such as the desktop, start menu, and personal documents.
  260. <UL>
  261.   <CODE><Job Id="SpecialFolder"><BR>
  262.   <script language=PerlScript><BR>
  263.   $WshShell = $WScript->CreateObject("WScript.Shell");<BR>
  264.   $numFolders = $WshShell->SpecialFolders->{Count};<BR>
  265.   $title = "PerlScript & WSH Example";<BR>
  266.   $style = 1;<BR>
  267.   <BR>
  268.   for($i=0; $i<$numFolders; $i++) {<BR>
  269.   $ok_or_cancel = $WshShell->Popup(<BR>
  270.   $WshShell->SpecialFolders($i),<BR>
  271.   undef,<BR>
  272.   $title,<BR>
  273.   $style);<BR>
  274.   <BR>
  275.   exit if ($ok_or_cancel == 2);<BR>
  276.   }<BR>
  277.   <BR>
  278.   </script><BR>
  279.   </job></CODE>
  280. </UL>
  281. </A><A name="registry">
  282. <H3>Working With the Registry</H3>
  283. The WshShell object provides functionality for working with the registry. The three methods for this
  284. are: <CODE>RegRead</CODE>, <CODE>RegWrite</CODE>, and <CODE>RegDelete</CODE>. Simply provide either
  285. method with a string such as the short form HKCU\ScriptEngine\Val or longer variant
  286. HKEY_CURRENT_USER\ScrtipeEngine\Val. Notice that a key is returned if the last character is a
  287. backslash, and a value is returned if no backslash is at the end. The RegRead method supports the
  288. following data types
  289. <UL>
  290.   <LI>REG_SZ
  291.   <LI>REG_EXPAND_SZ
  292.   <LI>REG_DWORD
  293.   <LI>REG_BINARY
  294.   <LI>REG_MULTI_SZ
  295. </UL>
  296. RegWrite requires a few extra parameters:
  297. <UL>
  298.   <CODE>$WshShell->RegWrite(Name, Value [,Type]);</CODE>
  299. </UL>
  300. The name is a fully qualified string such as HKCU\ScriptEngine\Val where the same rules apply for
  301. key and value as previously mentioned. The Type-parameter is optional, but if used, it must be one
  302. of the following data types:
  303. <UL>
  304.   <LI>REG_SZ
  305.   <LI>REG_EXPAND_SZ
  306.   <LI>REG_DWORD
  307.   <LI>REG_BINARY
  308. </UL>
  309. </A><A name="misc">
  310. <H3>Miscellanous</H3>
  311. Expands the requested environment variable from the running process:
  312. <UL>
  313.   <CODE>$WshShell->ExpandEnvironmentStrings($string);</CODE>
  314. </UL>
  315. In addition, log an event in the NT event log or WSH.log (Windows 9x) file using:
  316. <UL>
  317.   <CODE>$WshShell->LogEvent(Type, Message [,Target]);</CODE>
  318. </UL>
  319. Target is the name of the system on NT, thus only applicable on NT. The Type of event is either
  320. <UL>
  321.   <LI>0 (SUCCESS)
  322.   <LI>1 (ERROR)
  323.   <LI>2 (WARNING)
  324.   <LI>4 (INFORMATION),
  325.   <LI>8 (AUDIT_SUCCESS)
  326.   <LI>16 (AUDIT_FAILURE)
  327. </UL>
  328. This method returns a boolean value indicating success or failure. Another method is Popup, which
  329. sends a Windows messagebox up on the screen.
  330. <UL>
  331.   <CODE>$retval = $WshShell->Popup(Text, [SecondsWait], [Title], [Type]);</CODE>
  332. </UL>
  333. The method allows you to define the text to pop up, alternatively seconds to wait before closing
  334. window, the title of the window, and lastly the type of buttons available in the window. They can
  335. be:
  336. <UL>
  337.   <LI>0 (Ok)
  338.   <LI>1 (Ok and Cancel)
  339.   <LI>2 (Abort, Retry, and Ignore)
  340.   <LI>3 (Yes, No, and Cancel)
  341.   <LI>4 (Yes and No)
  342.   <LI>5 (Retry and Cancel)
  343. </UL>
  344. The value that you choose can also be combined with an icon:
  345. <UL>
  346.   <LI>16 (Stop Mark)
  347.   <LI>32 (Question Mark)
  348.   <LI>48 (Exclamation Mark)
  349.   <LI>64 (Information Mark)
  350. </UL>
  351. The return values returned to <CODE>$retval</CODE> indicates which button was pressed. The value
  352. will be one of the following:
  353. <UL>
  354.   <LI>1 (OK)
  355.   <LI>2 (Cancel)
  356.   <LI>3 (Abort)
  357.   <LI>4 (Retry)
  358.   <LI>5 (Ignore)
  359.   <LI>6 (Yes)
  360.   <LI>7 (No)
  361. </UL>
  362. </A><A name="network">
  363. <H2>The WshNetwork Object</H2>
  364. The WshNetwork object exposes some network functionality. To begin:
  365. <UL>
  366.   <CODE>$WshNetwork->AddPrinterConnection($LocalName, $RemoteName[,$UpdateProfile][,$User][,$Password]);</CODE>
  367. </UL>
  368. User and password are parameters two parameters with given meaning. Localname and Remotename is the
  369. name of the printer resource. Set UpdateProfile to TRUE for storing this mapping in the user
  370. profile. Next, AddWindowsPrinterConnection() adds a printer just as you would add one using the
  371. control panel. On Windows NT/2000 the only parameter you need to call this method with is the path
  372. to the printer while windows 9x requires you to specify the driver to use, and optionally specify
  373. which port to which it is connected. In the last event, the syntax is:
  374. <UL>
  375.   <CODE>$WshNetwork->AddWindowsPrinterConnection($PrinterPath, $DriverName[,$Port])</CODE>
  376. </UL>
  377. As easily as adding a printer, you can remove a printer. Simply do <CODE>$WshNetwork->RemovePrinterConnection($Name,
  378. [$Force], [$UpdateProfile]);</CODE> If you set $Force to TRUE (1), it will remove the connection
  379. regardless if it is being used, and setting $UpdateProfile to true will remove any user profile
  380. mapping.<BR>
  381. <BR>
  382. If you're happy with your printers, you can set one of the printer as your default printer by a
  383. quick call:
  384. <UL>
  385.   <CODE>$WshNetwork->SetDefaultPrinter($PrinterName);</CODE>
  386. </UL>
  387. To return a collection of all your printers, call:
  388. <UL>
  389.   <CODE>$Printers = $WshNetwork->EnumPrinterConnections();</CODE>
  390. </UL>
  391. Then use the Count-property to retrieve the number of items in the $Printers collection object.<BR>
  392. <BR>
  393. When you want to map a drive to a network share, you can use the MapNetworkDrive method. <CODE>$WshNetwork->MapNetworkDrive($LocalName,
  394. $RemoteName, [$UpdateProfile], [$User], [$Password]);</CODE> For example:
  395. <UL>
  396.   <CODE>$WshNetwork->MapNetworkDrive('C:\', '\\MyComputerServer\\ShareHere);</CODE>
  397. </UL>
  398. Remove a network drive using the now familiar syntax <CODE>$WshNetwork->RemoveNetworkDrive($Name,
  399. [$Force], [$UpdateProfile])</CODE> or enumerate the network drives as:
  400. <UL>
  401.   <CODE>$Drives = $WshNetwork->EnumNetworkDrive();</CODE>
  402. </UL>
  403. <BR>
  404. <BR>
  405. The three properties of the network object are ComputerName, UserName, and UserDomain.</A><A name="elementref">
  406. <H2>XML Element Reference</H2>
  407. Like Windows Script Components, the Windows Script Host has a set of XML elements that can be
  408. deployed. For a basic understanding of how they are used, please refer to the section about Windows
  409. Script Components.</A><A name="elemjob">
  410. <H3>The Job Element</H3>
  411. The Job element is used to define the beginning and the end of the components. It encapsulates all
  412. other tags. Would your WSH file contain more than one job, encapsulate them within a <PACKAGE>
  413. element. When declaring jobs, the ID attribute is optional. Syntax:
  414. <UL>
  415.   <CODE><Job [id=JobID]></CODE>
  416. </UL>
  417. For example:
  418. <UL>
  419.   <PRE><CODE><package>   </CODE></PRE>
  420.   <CODE>
  421.   <UL>
  422.     <PRE><Job id="PrintOutput">
  423. </Job>   </PRE>
  424.   </UL>
  425.   <UL>
  426.     <PRE><Job id="ReadInput">
  427. </Job>   </PRE>
  428.   </UL>
  429.   <PRE></package></CODE></PRE>
  430. </UL>
  431. <BR>
  432. <BR>
  433. You can also set a boolean value of true (1) or false (0) for error checking or debugging by using
  434. the additional tag <CODE><? job error="true" debug="true" ?></CODE><BR>
  435. <BR>
  436. </A>
  437. <PRE><A name="elemscr"> </A></PRE>
  438. <A name="elemscr">
  439. <H3>The Script Element</H3>
  440. The script element lets you define the scripting language to use, and then with its closing-tag
  441. functions as delimiters for the script code. Syntax:
  442. <UL>
  443.   <CODE><script language="languageName"> code </script></CODE>
  444. </UL>
  445. For example.
  446. <UL>
  447.   <CODE><BR>
  448.   <?XML version="1.0"?><BR>
  449.   <job><BR>
  450.   ...<BR>
  451.   <script language="PerlScriptt"><BR>
  452.   <![CDATA[<BR>
  453.   sub ReturnValue {<BR>
  454.   #<BR>
  455.   # Perl code here<BR>
  456.   #<BR>
  457.   }<BR>
  458.   ]]><BR>
  459.   </script><BR>
  460.   </job></CODE>
  461. </UL>
  462. <BR>
  463. <BR>
  464. </A><A name="elemres">
  465. <H3>The Resource Element</H3>
  466. The resource element is a placeholder for strings or numeric data that should be separate from the
  467. script commands yet may be used within the script. Syntax:
  468. <PRE><resource id="resourceID"> 
  469.  text or number to represent resource goes here   
  470. </resource></PRE>
  471. You use the <CODE>getResource(resourceID)</CODE> to retrieve the contents of the resource specified
  472. in the resourceID parameter.<BR>
  473. <BR>
  474. </A>
  475. <PRE><A name="elemref"></A> </PRE>
  476. <H3>The Reference Element</H3>
  477. You can import external type libraries by using the reference element. By importing a type library,
  478. you will be able to naturally access the constants that belongs to it, too. Syntax:
  479. <PRE><reference
  480.     [object="progID"|guid="typelibGUID"] [version="versionNo"]
  481. />
  482. </PRE>
  483. <HR>
  484. <H1><A name="author and copyright">AUTHOR AND COPYRIGHT</A></H1>
  485. <P>Written document copyright (c) 2000 Tobias Martinsson. All rights reserved.</P>
  486. <P>When included as part of the Standard Version of Perl, or as part of its complete documentation
  487. whether printed or otherwise, this work may be distributed only under the terms of Perl's Artistic
  488. License. Any distribution of this file or derivatives thereof <EM>outside</EM> of that package
  489. require that special arrangements be made with copyright holder.</P>
  490. <P>Irrespective of its distribution, all code examples in this file are hereby placed into the
  491. public domain. You are permitted and encouraged to use this code in your own programs for fun or for
  492. profit as you see fit. A simple comment in the code giving credit would be courteous but is not
  493. required.</P>
  494. <P>Windows Script Host is copyright (c) 1991-1999 Microsoft Corporation. All Rights Reserved.</P>
  495. <TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
  496.   <TR>
  497.     <TD class="block" valign="MIDDLE" width="100%" bgcolor="#cccccc"><STRONG>
  498.       <P class="block"> Rough Guide to Windows Script Host</P>
  499.       </STRONG></TD>
  500.   </TR>
  501. </TABLE>
  502.  
  503. </BODY>
  504.  
  505. </HTML>
  506.