Listing 1: The Main Block of Code in Computer_Inventory.vbs ' Call the routine that creates the log file. WScript.Echo "Log file creation " & logfilename createlogfile logfilename ' Call the routine that creates the database. createdb dbname,tablename,sw ' Read the computer.txt file. WScript.Echo "Reading computer file " & filecomputer Set objFSO = CreateObject("Scripting.FileSystemObject") Set objTextFile = objFSO.OpenTextFile(filecomputer,ForReading) Do While objTextFile.AtEndOfStream <> True strLinetoParse = objTextFile.ReadLine First_char = Left(strLinetoParse, 1) ' Bypass the rows starting with an asterisk. If (First_char <> star) And (First_char <> " ") Then hostname = Trim(strLinetoParse) WScript.Echo "Retrieving information about computer " & hostname Get_user_info hostname ' ------- BEGIN CALLOUT A ------- If SerialNumber > 0 Then hostname = strLinetoParse WScript.Echo "Insert / Update DB for computer " & hostname addrectodb hostname,OSType,CSDVersion,SerialNumber,Version,Windir SerialNumber = 0 Else msg = "=====> Hostname " & hostname & " not found or Down" WScript.Echo "Computer " & hostname & " not found or Down" writetofile msg,Forappend End if ' ------- END CALLOUT A ------- End if Loop objTextFile.Close