Just a bit of a cleanup with the multiple file method
 Code:
Break on

; Declare variables to prevent scope creep
Dim $InFile, $OutFile			; file names for input and output
Dim $Computer				; computer name, from input file
Dim $Rc					; return-code catcher
Dim $Version				; Version data from Computer

$Rc = SetOption('NoVarsInStings', 'On')


$OutFile = ('c:\test\version.txt')
$InFile  = ('C:\test\ie8.txt')

; Open the input file - no strings in quotes!
If Open( 1 , $InFile) <> 0
  'Failed to open ' $InFile ' - aborting!' ?
  Exit 1
EndIf

; same for the output file
If Open( 2 , $OutFile, 5) <> 0
  'Failed to open ' $OutFile ' - aborting!' ?
  Exit 1
EndIf

; Read the first line, then loop until EOD (End Of Data) error
$Computer = ReadLine(1)
While Not @ERROR

  'Computer: ' $Computer ?		; display the current computer

  ; Only read the registry if the computer is online
  If Ping($Computer)
    $Version = Readvalue('\\' + $Computer + '\HKLM\SOFTWARE\Microsoft\Internet Explorer', 'Version')
  Else
    $Version = 'PC Not Online'		; no ping response
  EndIf

  ; If the registry data is blank, provide appropriate message
  $Version = IIf($Version, $Version, 'Invalid data from PC')

  'Version: ' $Version ?		Display version

  $Rc = WriteLine(2, $Version + ' ' + $Computer + @CRLF)

  $Computer = ReadLine(1)

Loop

$Rc = Close(1)
$Rc = Close(2)
Couple of pointers

Putting variables inside of strings is not good practice. Think about trying to output a $ in a string - how does the program know when you want to output $12 and not the content of a variable? It isn't "natural" to write "$$" when you mean "$" either..

You preloaded $Version with an error string and then loaded it from the remote registry read. If you had used the "If Ping($computer) logic, that might have worked, but one just overwrites the other. In the example above, there are clear error messages when a PC doesn't respond or provides bad (empty) data.

Without using the Ping test, your query could take many seconds to determine that a PC isn't online.. with Ping, it only takes 2-3 seconds. This could mean the difference between the process taking minutes or an hour, depending on the number of computers to query and how many were active.

"?" is a shortcut for @CRLF, not for a PRINT statement as in BASIC.. it's more natural to put it at the end of a line of output, as you did with the @CRLF in your WriteLine statement.

Nesting the If statements when opening the files doesn't serve any extra value, so just "bark and die" if the files fail to open. You "could" use the error message @SERROR to display the reason if you so choose.

As your code gets more complex, you'll need to make use of Shell and Run commands. These often REQUIRE the use of double-quotes, so it's best to get in the habit of using single quotes for Kix, making it easy to embed double-quotes in commands or strings.

Don't be discouraged by these comments - these things aren't "wrong", just concepts that make it easier to build larger or more complex and robust scripts.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D