Hi ,
i want to write a file to C:\\Program Files\\ using c#
Here is what i have

string currentsnap = "C:\\Program Files\\currentsnap.txt";
  commandtorun("route print > " + currentsnap);

command to run funtion is given below

private static void [B]commandtorun[/B](string commandexecuted)

            string currentstatus;
            ProcessStartInfo startInfo = new ProcessStartInfo();
            Process myprocess = new Process();
                startInfo.FileName = "cmd"; //
                startInfo.RedirectStandardInput = true;
                startInfo.RedirectStandardOutput = true;
                startInfo.UseShellExecute = false; //'required to redirect
                startInfo.CreateNoWindow = true; // '<---- creates no window, obviously
                myprocess.StartInfo = startInfo; //
                myprocess.Start(); //
                System.IO.StreamReader SR;
                System.IO.StreamWriter SW;
                SR = myprocess.StandardOutput;
                SW = myprocess.StandardInput;
                SW.WriteLine(commandexecuted); // 'the command you wish to run.....
                SW.WriteLine("exit"); // 'exits command prompt window
                currentstatus = SR.ReadToEnd();
                //  return currenttable;

I am able to write to c:\\ folder , but not to c:\\program files. I think the problem is with the space between program and files