LISTING 1: ShowLineNumbers.vbs BEGIN COMMENT ' Initialization END COMMENT Const TEMP_FILE = "C:\mytempfile.txt" Const ForReading = 1 Const ForWriting = 2 Dim strInput, wshShell, fso strInput = "" Set wshShell = CreateObject("WScript.Shell") Set fso = CreateObject("Scripting.FileSystemObject") BEGIN COMMENT ' Arguments END COMMENT ' BEGIN CALLOUT A If WScript.Arguments.Count > 1 Then strInput = Trim(InputBox("One file only allowed. All input ignored. Enter the full path here:")) ElseIf WScript.Arguments.Count = 0 Then strInput = Trim(InputBox("Enter the full path here:")) Else strInput = WScript.Arguments(0) End If If strInput = "" Then MsgBox "No file specified!" WScript.Quit End If If Not fso.FileExists(strInput) Then MsgBox strInput & " does not exist!" WScript.Quit End If ' END CALLOUT A BEGIN COMMENT ' New file creation END COMMENT ' BEGIN CALLOUT B Set filSource = fso.OpenTextFile(strInput, ForReading) Set filDest = fso.OpenTextFile(TEMP_FILE, ForWriting, True) While Not filSource.AtEndOfStream filDest.WriteLine filSource.Line & ": " & filSource.ReadLine Wend filSource.Close filDest.Close ' END CALLOUT B BEGIN COMMENT ' End END COMMENT ' BEGIN CALLOUT C wshShell.Run TEMP_FILE WScript.Sleep 10000 fso.DeleteFile TEMP_FILE ' END CALLOUT C