Chris Darken 0 Newbie Poster

Im trying to write a small console application to read a text file of servers and run then run a command and inject the name of the server into the command, then interate through the whole text file. My problem is that the app launches, the process launches, then it errors out so fast I dont know whats going wrong. Ive tried to write the standardoutput to a string, pass the string back and then write the string to the console window but it isnt working. Could someone please take a look and point me in the right direction, Ive done a lot of head -> wall and not gotten anywhere.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            /*
             * Create an array of strings(strLine) to store server names in. The intent is to push out a command line of
             * iisback using strLine[i] inject into the line as a server name and iterate through the array. Read in the 
             * entire file, then split the array down into a managable size using split on "\n". This should down size 
             * the array and make it more managable.
             * 
             */
            const int maxArraySize = 100;
            string[] strLine = new string[maxArraySize];
            string strFullFile;
            char splitval = Convert.ToChar("\n");
            string username = "888888";
            string password = "88888";
            string backupname = "Weekly_Backup";
            string strLineCount;

            try
            {   //Read the server list file into the array
                FileStream serverNameList = new FileStream("test.txt", FileMode.Open);
                StreamReader sr = new StreamReader(serverNameList);
                strFullFile = sr.ReadToEnd();
                strLine = strFullFile.Split(splitval);

                for (int i = 0; i <= strLine.Length; i++)
                {
                    strLineCount = strLine[i];
                    string output = iisbackProc(strLineCount, username, password, backupname);
                    Console.Write(output);
                }
                Console.ReadKey();

            }

            catch (IOException e)
            {
                Console.WriteLine("An IO exception has been thrown!");
                Console.WriteLine(e.ToString());
            }
            Console.ReadKey();

        }
        

        private static string iisbackProc(string strLineCount, string username, string password, string backupname)
        {
            //Declare and instantiate a new process component.
            System.Diagnostics.Process process1;
            process1 = new System.Diagnostics.Process();

            //Do not receive an event when the process exits.
            process1.EnableRaisingEvents = false;

            System.Diagnostics.Process proc = new System.Diagnostics.Process();
            proc.StartInfo.UseShellExecute = false;
            proc.StartInfo.RedirectStandardOutput = true;
            proc.StartInfo.RedirectStandardError = true;
            proc.EnableRaisingEvents = false;
            proc.StartInfo.FileName = "iisback.vbs";
            proc.StartInfo.Arguments = " /backup /s " + strLineCount + " /u " + username + " /p " + password + " /b " + backupname + " /v NEXT_VERSION";
            proc.Start();
            string output = proc.StandardOutput.ReadToEnd();
            proc.WaitForExit();

            return output;
        }
    }
}