home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 May / W2KPRK.iso / ras.cab / listspace.vbs < prev    next >
Text File  |  1999-11-04  |  23KB  |  663 lines

  1. '********************************************************************
  2. '*
  3. '* File:           ListSpace.vbs
  4. '* Created:        March 1999
  5. '* Version:        1.0
  6. '*
  7. '*  Main Function:  Lists total disk space on all drives of a machine.
  8. '*
  9. '*  ListSpace.vbs      [/S <server>] [/U <username>] [/W <password>] 
  10. '*                     [/O <outputfile>]
  11. '*
  12. '* Copyright (C) 1999 Microsoft Corporation
  13. '*
  14. '********************************************************************
  15.  
  16. OPTION EXPLICIT
  17.  
  18.     'Define constants
  19.     CONST CONST_ERROR                   = 0
  20.     CONST CONST_WSCRIPT                 = 1
  21.     CONST CONST_CSCRIPT                 = 2
  22.     CONST CONST_SHOW_USAGE              = 3
  23.     CONST CONST_PROCEED                 = 4
  24.  
  25.     'Declare variables
  26.     Dim intOpMode, i
  27.     Dim strServer, strUserName, strPassword, strOutputFile
  28.  
  29.     'Make sure the host is csript, if not then abort
  30.     VerifyHostIsCscript()
  31.  
  32.     'Parse the command line
  33.     intOpMode = intParseCmdLine(strServer     ,  _
  34.                                 strUserName   ,  _
  35.                                 strPassword   ,  _
  36.                                 strOutputFile    )
  37.  
  38.  
  39.     Select Case intOpMode
  40.  
  41.         Case CONST_SHOW_USAGE
  42.             Call ShowUsage()
  43.  
  44.         Case CONST_PROCEED                 
  45.             Call ListSpace(strServer     , _
  46.                            strOutputFile , _
  47.                            strUserName   , _
  48.                            strPassword     )
  49.  
  50.         Case CONST_ERROR
  51.             'Do Nothing
  52.  
  53.         Case Else                    'Default -- should never happen
  54.             Call Wscript.Echo("Error occurred in passing parameters.")
  55.  
  56.     End Select
  57.  
  58. '********************************************************************
  59. '* End of Script
  60. '********************************************************************
  61.  
  62. '********************************************************************
  63. '*
  64. '* Sub ListSpace()
  65. '* Purpose: Lists the size of each drive on a machine.
  66. '* Input:   strServer     a machine name
  67. '*          strUserName   the current user's name
  68. '*          strPassword   the current user's password
  69. '*          strOutputFile an output file name
  70. '* Output:  Results of the search are either printed on screen or saved 
  71. '*          in strOutputFile.
  72. '*
  73. '********************************************************************
  74.  
  75. Private Sub ListSpace(strServer, strUserName, strPassword, strOutputFile)
  76.  
  77.     ON ERROR RESUME NEXT
  78.  
  79.     Dim objFileSystem, objOutputFile, objService, objEnumerator, objInstance
  80.     Dim strQuery, strMessage
  81.     Dim lngSpace
  82.     'Open a text file for output if the file is requested
  83.     If Not IsEmpty(strOutputFile) Then
  84.         If (NOT blnOpenFile(strOutputFile, objOutputFile)) Then
  85.             Call Wscript.Echo ("Could not open an output file.")
  86.             Exit Sub
  87.         End If
  88.     End If
  89.  
  90.     'Establish a connection with the server.
  91.     If blnConnect("root\cimv2" , _
  92.                    strUserName , _
  93.                    strPassword , _
  94.                    strServer   , _
  95.                    objService  ) Then
  96.         Call Wscript.Echo("")
  97.         Call Wscript.Echo("Please check the server name, " _
  98.                         & "credentials and WBEM Core.")
  99.         Exit Sub
  100.     End If
  101.  
  102.     strQuery = "Select Size, DeviceID From Win32_LogicalDisk"
  103.  
  104.     Set objEnumerator = objService.ExecQuery(strQuery,,0)
  105.     If Err.Number Then
  106.         Print "Error 0x" & CStr(Hex(Err.Number)) & " occurred during the query."
  107.         If Err.Description <> "" Then
  108.             Print "Error description: " & Err.Description & "."
  109.         End If
  110.         Err.Clear
  111.         Exit Sub
  112.     End If
  113.  
  114.     For Each objInstance in objEnumerator
  115.         If Not (objInstance is nothing) Then
  116.             strMessage = Space(2) & strPackString(objInstance.DeviceID, 5, 1, 0)
  117.             lngSpace = objInstance.Size
  118.             If lngSpace <> 0 Then
  119.                 strMessage = strMessage & _
  120.                              strPackString(strInsertCommas(lngSpace), _
  121.                              15, 0, 0 ) & " bytes"
  122.             Else
  123.                 strMessage = strMessage & strPackString("not available", _
  124.                              15, 0, 0)
  125.             End If
  126.             WriteLine strMessage, objOutputFile
  127.         End If
  128.         If Err.Number Then
  129.             Err.Clear
  130.         End If
  131.     Next
  132.  
  133.     If IsObject(objOutputFile) Then
  134.         objOutputFile.Close
  135.         Call Wscript.Echo ("Results are saved in file " & strOutputFile & ".")
  136.     End If
  137.  
  138. End Sub
  139.  
  140. '********************************************************************
  141. '*
  142. '* Function intParseCmdLine()
  143. '*
  144. '* Purpose: Parses the command line.
  145. '* Input:   
  146. '*
  147. '* Output:  strServer         a remote server ("" = local server")
  148. '*          strUserName       the current user's name
  149. '*          strPassword       the current user's password
  150. '*          strOutputFile     an output file name
  151. '*
  152. '********************************************************************
  153. Private Function intParseCmdLine( ByRef strServer,        _
  154.                                   ByRef strUserName,      _
  155.                                   ByRef strPassword,      _
  156.                                   ByRef strOutputFile     )
  157.  
  158.  
  159.     ON ERROR RESUME NEXT
  160.  
  161.     Dim strFlag
  162.     Dim intState, intArgIter
  163.     Dim objFileSystem
  164.  
  165.     If Wscript.Arguments.Count > 0 Then
  166.         strFlag = Wscript.arguments.Item(0)
  167.     End If
  168.  
  169.     If IsEmpty(strFlag) Then                'No arguments have been received
  170.         intParseCmdLine = CONST_PROCEED
  171.         Exit Function
  172.     End If
  173.  
  174.     'Check if the user is asking for help or is just confused
  175.     If (strFlag="help") OR (strFlag="/h") OR (strFlag="\h") OR (strFlag="-h") _
  176.         OR (strFlag = "\?") OR (strFlag = "/?") OR (strFlag = "?") _ 
  177.         OR (strFlag="h") Then
  178.         intParseCmdLine = CONST_SHOW_USAGE
  179.         Exit Function
  180.     End If
  181.  
  182.     'Retrieve the command line and set appropriate variables
  183.      intArgIter = 0
  184.     Do While intArgIter <= Wscript.arguments.Count - 1
  185.         Select Case Left(LCase(Wscript.arguments.Item(intArgIter)),2)
  186.   
  187.             Case "/s"
  188.                 If Not blnGetArg("Server", strServer, intArgIter) Then
  189.                     intParseCmdLine = CONST_ERROR
  190.                     Exit Function
  191.                 End If
  192.                 intArgIter = intArgIter + 1
  193.  
  194.             Case "/o"
  195.                 If Not blnGetArg("Output File", strOutputFile, intArgIter) Then
  196.                     intParseCmdLine = CONST_ERROR
  197.                     Exit Function
  198.                 End If
  199.                 intArgIter = intArgIter + 1
  200.  
  201.             Case "/u"
  202.                 If Not blnGetArg("User Name", strUserName, intArgIter) Then
  203.                     intParseCmdLine = CONST_ERROR
  204.                     Exit Function
  205.                 End If
  206.                 intArgIter = intArgIter + 1
  207.  
  208.             Case "/w"
  209.                 If Not blnGetArg("User Password", strPassword, intArgIter) Then
  210.                     intParseCmdLine = CONST_ERROR
  211.                     Exit Function
  212.                 End If
  213.                 intArgIter = intArgIter + 1
  214.  
  215.             Case Else 'We shouldn't get here
  216.                 Call Wscript.Echo("Invalid or misplaced parameter: " _
  217.                    & Wscript.arguments.Item(intArgIter) & vbCRLF _
  218.                    & "Please check the input and try again," & vbCRLF _
  219.                    & "or invoke with '/?' for help with the syntax.")
  220.                 Wscript.Quit
  221.  
  222.         End Select
  223.  
  224.     Loop '** intArgIter <= Wscript.arguments.Count - 1
  225.  
  226.     If IsEmpty(intParseCmdLine) Then _
  227.         intParseCmdLine = CONST_PROCEED
  228.  
  229. End Function
  230.  
  231. '********************************************************************
  232. '*
  233. '* Sub ShowUsage()
  234. '*
  235. '* Purpose: Shows the correct usage to the user.
  236. '*
  237. '* Input:   None
  238. '*
  239. '* Output:  Help messages are displayed on screen.
  240. '*
  241. '********************************************************************
  242. Private Sub ShowUsage()
  243.  
  244.     Wscript.Echo ""
  245.     Wscript.Echo "Lists total disk space on all drives of a machine."
  246.     Wscript.Echo ""
  247.     Wscript.Echo "SYNTAX:"
  248.     Wscript.Echo "  ListSpace.vbs [/S <server>] [/U <username>]" _
  249.                 &" [/W <password>]"
  250.     Wscript.Echo "  [/O <outputfile>]"
  251.     Wscript.Echo ""
  252.     Wscript.Echo "PARAMETER SPECIFIERS:"
  253.     Wscript.Echo "   server        A machine name."
  254.     Wscript.Echo "   username      The current user's name."
  255.     Wscript.Echo "   password      Password of the current user."
  256.     Wscript.Echo "   outputfile    The output file name."
  257.     Wscript.Echo ""
  258.     Wscript.Echo "EXAMPLE:"
  259.     Wscript.Echo "1. ListSpace.vbs"
  260.     Wscript.Echo "   Lists the total space on all local drives."
  261.     Wscript.Echo "2. ListSpace.vbs /S:MyMachine2"
  262.     Wscript.Echo "   Lists the total space on all drives of MyMachine2."
  263.  
  264. End Sub
  265.  
  266. '********************************************************************
  267. '* General Routines
  268. '********************************************************************
  269.  
  270. '********************************************************************
  271. '*
  272. '* Function strInsertCommas()
  273. '*
  274. '* Purpose: Puts commas into an interger to make it more readable.
  275. '*
  276. '* Input:   intValue    an integer
  277. '*
  278. '* Output:  strInsertCommas  A String
  279. '*
  280. '********************************************************************
  281. Function strInsertCommas(intValue)
  282.  
  283.     Dim IntPlace
  284.  
  285.     strInsertCommas = ""
  286.     intPlace = 0 
  287.     For I = len(intValue) to 1 Step - 1
  288.         strInsertCommas = Mid(intValue,I,1) & strInsertCommas
  289.         intPlace = intPlace + 1
  290.         If intPlace = 3 then
  291.             strInsertCommas = "," & strInsertCommas
  292.             intPlace = 0
  293.         End If
  294.     Next
  295.     If Left(strInsertCommas,1) = "," then
  296.         strInsertCommas = Right(strInsertCommas, len(strInsertCommas) -1)
  297.     End If
  298.  
  299. End Function
  300.  
  301. '********************************************************************
  302. '*
  303. '* Function strPackString()
  304. '*
  305. '* Purpose: Attaches spaces to a string to increase the length to intWidth.
  306. '*
  307. '* Input:   strString   a string
  308. '*          intWidth    the intended length of the string
  309. '*          blnAfter    Should spaces be added after the string?
  310. '*          blnTruncate specifies whether to truncate the string or not if
  311. '*                      the string length is longer than intWidth
  312. '*
  313. '* Output:  strPackString is returned as the packed string.
  314. '*
  315. '********************************************************************
  316. Private Function strPackString( ByVal strString, _
  317.                                 ByVal intWidth,  _
  318.                                 ByVal blnAfter,  _
  319.                                 ByVal blnTruncate)
  320.  
  321.     ON ERROR RESUME NEXT
  322.  
  323.     intWidth      = CInt(intWidth)
  324.     blnAfter      = CBool(blnAfter)
  325.     blnTruncate   = CBool(blnTruncate)
  326.  
  327.     If Err.Number Then
  328.         Call Wscript.Echo ("Argument type is incorrect!")
  329.         Err.Clear
  330.         Wscript.Quit
  331.     End If
  332.  
  333.     If IsNull(strString) Then
  334.         strPackString = "null" & Space(intWidth-4)
  335.         Exit Function
  336.     End If
  337.  
  338.     strString = CStr(strString)
  339.     If Err.Number Then
  340.         Call Wscript.Echo ("Argument type is incorrect!")
  341.         Err.Clear
  342.         Wscript.Quit
  343.     End If
  344.  
  345.     If intWidth > Len(strString) Then
  346.         If blnAfter Then
  347.             strPackString = strString & Space(intWidth-Len(strString))
  348.         Else
  349.             strPackString = Space(intWidth-Len(strString)) & strString & " "
  350.         End If
  351.     Else
  352.         If blnTruncate Then
  353.             strPackString = Left(strString, intWidth-1) & " "
  354.         Else
  355.             strPackString = strString & " "
  356.         End If
  357.     End If
  358.  
  359. End Function
  360.  
  361. '********************************************************************
  362. '* 
  363. '*  Function blnGetArg()
  364. '*
  365. '*  Purpose: Helper to intParseCmdLine()
  366. '* 
  367. '*  Usage:
  368. '*
  369. '*     Case "/s" 
  370. '*       blnGetArg ("server name", strServer, intArgIter)
  371. '*
  372. '********************************************************************
  373. Private Function blnGetArg ( ByVal StrVarName,   _
  374.                              ByRef strVar,       _
  375.                              ByRef intArgIter) 
  376.  
  377.     blnGetArg = False 'failure, changed to True upon successful completion
  378.  
  379.     If Len(Wscript.Arguments(intArgIter)) > 2 then
  380.         If Mid(Wscript.Arguments(intArgIter),3,1) = ":" then
  381.             If Len(Wscript.Arguments(intArgIter)) > 3 then
  382.                 strVar = Right(Wscript.Arguments(intArgIter), _
  383.                          Len(Wscript.Arguments(intArgIter)) - 3)
  384.                 blnGetArg = True
  385.                 Exit Function
  386.             Else
  387.                 intArgIter = intArgIter + 1
  388.                 If intArgIter > (Wscript.Arguments.Count - 1) Then
  389.                     Call Wscript.Echo( "Invalid " & StrVarName & ".")
  390.                     Call Wscript.Echo( "Please check the input and try again.")
  391.                     Exit Function
  392.                 End If
  393.  
  394.                 strVar = Wscript.Arguments.Item(intArgIter)
  395.                 If Err.Number Then
  396.                     Call Wscript.Echo( "Invalid " & StrVarName & ".")
  397.                     Call Wscript.Echo( "Please check the input and try again.")
  398.                     Exit Function
  399.                 End If
  400.  
  401.                 If InStr(strVar, "/") Then
  402.                     Call Wscript.Echo( "Invalid " & StrVarName)
  403.                     Call Wscript.Echo( "Please check the input and try again.")
  404.                     Exit Function
  405.                 End If
  406.  
  407.                 blnGetArg = True 'success
  408.             End If
  409.         Else
  410.             strVar = Right(Wscript.Arguments(intArgIter), _
  411.                      Len(Wscript.Arguments(intArgIter)) - 2)
  412.             blnGetArg = True 'success
  413.             Exit Function
  414.         End If
  415.     Else
  416.         intArgIter = intArgIter + 1
  417.         If intArgIter > (Wscript.Arguments.Count - 1) Then
  418.             Call Wscript.Echo( "Invalid " & StrVarName & ".")
  419.             Call Wscript.Echo( "Please check the input and try again.")
  420.             Exit Function
  421.         End If
  422.  
  423.         strVar = Wscript.Arguments.Item(intArgIter)
  424.         If Err.Number Then
  425.             Call Wscript.Echo( "Invalid " & StrVarName & ".")
  426.             Call Wscript.Echo( "Please check the input and try again.")
  427.             Exit Function
  428.         End If
  429.  
  430.         If InStr(strVar, "/") Then
  431.             Call Wscript.Echo( "Invalid " & StrVarName)
  432.             Call Wscript.Echo( "Please check the input and try again.")
  433.             Exit Function
  434.         End If
  435.         blnGetArg = True 'success
  436.     End If
  437. End Function
  438.  
  439. '********************************************************************
  440. '*
  441. '* Function blnConnect()
  442. '*
  443. '* Purpose: Connects to machine strServer.
  444. '*
  445. '* Input:   strServer       a machine name
  446. '*          strNameSpace    a namespace
  447. '*          strUserName     name of the current user
  448. '*          strPassword     password of the current user
  449. '*
  450. '* Output:  objService is returned  as a service object.
  451. '*          strServer is set to local host if left unspecified
  452. '*
  453. '********************************************************************
  454. Private Function blnConnect(ByVal strNameSpace, _
  455.                             ByVal strUserName,  _
  456.                             ByVal strPassword,  _
  457.                             ByRef strServer,    _
  458.                             ByRef objService)
  459.  
  460.     ON ERROR RESUME NEXT
  461.  
  462.     Dim objLocator, objWshNet
  463.  
  464.     blnConnect = False     'There is no error.
  465.  
  466.     'Create Locator object to connect to remote CIM object manager
  467.     Set objLocator = CreateObject("WbemScripting.SWbemLocator")
  468.     If Err.Number then
  469.         Call Wscript.Echo( "Error 0x" & CStr(Hex(Err.Number)) & _
  470.                            " occurred in creating a locator object." )
  471.         If Err.Description <> "" Then
  472.             Call Wscript.Echo( "Error description: " & Err.Description & "." )
  473.         End If
  474.         Err.Clear
  475.         blnConnect = True     'An error occurred
  476.         Exit Function
  477.     End If
  478.  
  479.     'Connect to the namespace which is either local or remote
  480.     Set objService = objLocator.ConnectServer (strServer, strNameSpace, _
  481.        strUserName, strPassword)
  482.     ObjService.Security_.impersonationlevel = 3
  483.     If Err.Number then
  484.         Call Wscript.Echo( "Error 0x" & CStr(Hex(Err.Number)) & _
  485.                            " occurred in connecting to server " _
  486.            & strServer & ".")
  487.         If Err.Description <> "" Then
  488.             Call Wscript.Echo( "Error description: " & Err.Description & "." )
  489.         End If
  490.         Err.Clear
  491.         blnConnect = True     'An error occurred
  492.     End If
  493.  
  494.     'Get the current server's name if left unspecified
  495.     If IsEmpty(strServer) Then
  496.         Set objWshNet = CreateObject("Wscript.Network")
  497.     strServer     = objWshNet.ComputerName
  498.     End If
  499.  
  500. End Function
  501.  
  502. '********************************************************************
  503. '*
  504. '* Sub      VerifyHostIsCscript()
  505. '*
  506. '* Purpose: Determines which program is used to run this script.
  507. '*
  508. '* Input:   None
  509. '*
  510. '* Output:  If host is not cscript, then an error message is printed 
  511. '*          and the script is aborted.
  512. '*
  513. '********************************************************************
  514. Sub VerifyHostIsCscript()
  515.  
  516.     ON ERROR RESUME NEXT
  517.  
  518.     Dim strFullName, strCommand, i, j, intStatus
  519.  
  520.     strFullName = WScript.FullName
  521.  
  522.     If Err.Number then
  523.         Call Wscript.Echo( "Error 0x" & CStr(Hex(Err.Number)) & " occurred." )
  524.         If Err.Description <> "" Then
  525.             Call Wscript.Echo( "Error description: " & Err.Description & "." )
  526.         End If
  527.         intStatus =  CONST_ERROR
  528.     End If
  529.  
  530.     i = InStr(1, strFullName, ".exe", 1)
  531.     If i = 0 Then
  532.         intStatus =  CONST_ERROR
  533.     Else
  534.         j = InStrRev(strFullName, "\", i, 1)
  535.         If j = 0 Then
  536.             intStatus =  CONST_ERROR
  537.         Else
  538.             strCommand = Mid(strFullName, j+1, i-j-1)
  539.             Select Case LCase(strCommand)
  540.                 Case "cscript"
  541.                     intStatus = CONST_CSCRIPT
  542.                 Case "wscript"
  543.                     intStatus = CONST_WSCRIPT
  544.                 Case Else       'should never happen
  545.                     Call Wscript.Echo( "An unexpected program was used to " _
  546.                                        & "run this script." )
  547.                     Call Wscript.Echo( "Only CScript.Exe or WScript.Exe can " _
  548.                                        & "be used to run this script." )
  549.                     intStatus = CONST_ERROR
  550.                 End Select
  551.         End If
  552.     End If
  553.  
  554.     If intStatus <> CONST_CSCRIPT Then
  555.         Call WScript.Echo( "Please run this script using CScript." & vbCRLF & _
  556.              "This can be achieved by" & vbCRLF & _
  557.              "1. Using ""CScript ListSpace.vbs arguments"" for Windows 95/98 or" _
  558.              & vbCRLF & "2. Changing the default Windows Scripting Host " _
  559.              & "setting to CScript" & vbCRLF & "    using ""CScript " _
  560.              & "//H:CScript //S"" and running the script using" & vbCRLF & _
  561.              "    ""ListSpace.vbs arguments"" for Windows NT/2000." )
  562.         WScript.Quit
  563.     End If
  564.  
  565. End Sub
  566.  
  567. '********************************************************************
  568. '*
  569. '* Sub WriteLine()
  570. '* Purpose: Writes a text line either to a file or on screen.
  571. '* Input:   strMessage  the string to print
  572. '*          objFile     an output file object
  573. '* Output:  strMessage is either displayed on screen or written to a file.
  574. '*
  575. '********************************************************************
  576. Sub WriteLine(ByVal strMessage, ByVal objFile)
  577.  
  578.     On Error Resume Next
  579.     If IsObject(objFile) then        'objFile should be a file object
  580.         objFile.WriteLine strMessage
  581.     Else
  582.         Call Wscript.Echo( strMessage )
  583.     End If
  584.  
  585. End Sub
  586.  
  587. '********************************************************************
  588. '* 
  589. '* Function blnErrorOccurred()
  590. '*
  591. '* Purpose: Reports error with a string saying what the error occurred in.
  592. '*
  593. '* Input:   strIn        string saying what the error occurred in.
  594. '*
  595. '* Output:  displayed on screen 
  596. '* 
  597. '********************************************************************
  598. Private Function blnErrorOccurred (ByVal strIn)
  599.  
  600.     If Err.Number Then
  601.         Call Wscript.Echo( "Error 0x" & CStr(Hex(Err.Number)) & ": " & strIn)
  602.         If Err.Description <> "" Then
  603.             Call Wscript.Echo( "Error description: " & Err.Description)
  604.         End If
  605.         Err.Clear
  606.         blnErrorOccurred = True
  607.     Else
  608.         blnErrorOccurred = False
  609.     End If
  610.  
  611. End Function
  612.  
  613. '********************************************************************
  614. '* 
  615. '* Function blnOpenFile
  616. '*
  617. '* Purpose: Opens a file.
  618. '*
  619. '* Input:   strFileName        A string with the name of the file.
  620. '*
  621. '* Output:  Sets objOpenFile to a FileSystemObject and setis it to 
  622. '*            Nothing upon Failure.
  623. '* 
  624. '********************************************************************
  625. Private Function blnOpenFile(ByVal strFileName, ByRef objOpenFile)
  626.  
  627.     ON ERROR RESUME NEXT
  628.  
  629.     Dim objFileSystem
  630.  
  631.     Set objFileSystem = Nothing
  632.  
  633.     If IsEmpty(strFileName) OR strFileName = "" Then
  634.         blnOpenFile = False
  635.         Set objOpenFile = Nothing
  636.         Exit Function
  637.     End If
  638.  
  639.     'Create a file object
  640.     Set objFileSystem = CreateObject("Scripting.FileSystemObject")
  641.     If blnErrorOccurred("Could not create filesystem object.") Then
  642.         blnOpenFile = False
  643.         Set objOpenFile = Nothing
  644.         Exit Function
  645.     End If
  646.  
  647.     'Open the file for output
  648.     Set objOpenFile = objFileSystem.OpenTextFile(strFileName, 8, True)
  649.     If blnErrorOccurred("Could not open") Then
  650.         blnOpenFile = False
  651.         Set objOpenFile = Nothing
  652.         Exit Function
  653.     End If
  654.     blnOpenFile = True
  655.  
  656. End Function
  657.  
  658. '********************************************************************
  659. '*                                                                  *
  660. '*                           End of File                            *
  661. '*                                                                  *
  662. '********************************************************************
  663.