G
Guest
I am having issues copying files from network drive to local machine using
xcopy. The following code works alright for a console application, but as
soon as i call this code in Form Load event of windows application it does
not work. I am confused here, it copies files in a console application, but
not windows app
ProcessStartInfo info = new ProcessStartInfo("xcopy", "");
info.FileName = "xcopy";
info.Arguments = string.Format("\"{0}\" \"{1}\" /r/e/c/i/y/d",
@"\\melsrv01\Public\Templates\Austock Office\.",
@"C:\temp\Test Images");
info.UseShellExecute = false;
info.RedirectStandardOutput = true;
Process process = Process.Start(info);
string result = process.StandardOutput.ReadToEnd();
process.WaitForExit();
Console.WriteLine(result);
//MessageBox.Show(result);
Please help. Thanks
xcopy. The following code works alright for a console application, but as
soon as i call this code in Form Load event of windows application it does
not work. I am confused here, it copies files in a console application, but
not windows app
ProcessStartInfo info = new ProcessStartInfo("xcopy", "");
info.FileName = "xcopy";
info.Arguments = string.Format("\"{0}\" \"{1}\" /r/e/c/i/y/d",
@"\\melsrv01\Public\Templates\Austock Office\.",
@"C:\temp\Test Images");
info.UseShellExecute = false;
info.RedirectStandardOutput = true;
Process process = Process.Start(info);
string result = process.StandardOutput.ReadToEnd();
process.WaitForExit();
Console.WriteLine(result);
//MessageBox.Show(result);
Please help. Thanks