I tried out what you said, and came up with this:

Code:
        Shell("cmd /c ping 127.0.0.1 >C:\LocalHost.txt", vbHide)

        While IO.File.Exists("C:\LocalHost.txt") = False
            ProgressBar1.Value = 50
	'Using the progress bar to determine wether the text file exists or not.

        End While

        ProgressBar1.Value = 99

        Dim storage As String = File.ReadAllText("C:\LocalHost.txt")
        'An error is thrown here:
        'The process cannot access the file 'C:\LocalHost.txt' because it is being used by another process.

        Dim w As New IO.StreamWriter("C:\LocalHost.txt")
        w.WriteLine("This is a sample test for a log file")
        w.WriteLine("Testing.....")
        w.WriteLine("Testing again.....")
        w.WriteLine("Testing once again.........")
        w.WriteLine(storage)
        'w.WriteLine(storage)
        w.Close()

An example would be really helpful...