Practical 3

Task 3.1  In the following code,


Dim objNetwork

Set objNetwork = WScript.CreateObject("WScript.Network")

Set objDrives = objNetwork.EnumNetworkDrives

For i =0 to objDrives.count - 1 Step 2

    WScript.echo objDrives.Item(i) & ": " & objDrives.Item(i+1)

Next


why Step 2 is needed in the loop statement?


Task 3.2 Write a script that can list the following information:

  1.   Computer name

  2.   Domain name

  3.   User name

  4.   All connected drives

  5.   All connected printers


Task 3.3 Study Listing 3.1 (loginScript.vbs) of the textbook (page 40-41, Don Jones, VBScript, WMI and ADSI unleashed : using VBSscript, WMI, and ADSI to automate Windows administration eBook); and write your own logon script.


Task 3.4 Recall the WSH architecture shown in the figure below.



Read the following documents to reinforce your understanding of the WSH architecture (e.g. scripting support and built-in objects).


WSHCh01
WSHCh04


The documents above can also be viewed online at: http://wsh2.uw.hu/index.html