Dim i As Integer, str As String i=FreeFileOpen "C:\autoexec.bat" For Input As #i Do While Not EOF(i) Line Input #i, str Debug.Print str Loop Close #i