using System; using System.Diagnostics; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Robocopy : Form { public Robocopy() { InitializeComponent(); } private void Srcbutton_Click(object sender, EventArgs e) { folderBrowserDialog1.ShowDialog(); } private void Destbutton_Click(object sender, EventArgs e) { folderBrowserDialog2.ShowDialog(); } private void Cpybutton_Click(object sender, EventArgs e) { string SrcFold = folderBrowserDialog1.SelectedPath; string DestFold = folderBrowserDialog2.SelectedPath; string args = "\"" + SrcFold + "\" " + DestFold + "\" /E /COPY:dat"; ProcessStartInfo StartInfo = new ProcessStartInfo { WorkingDirectory = @"C:\RoboCopy_IT_Folder", Arguments = "args", FileName = @"C:\Windows\System32\robocopy.exe", RedirectStandardError = true, RedirectStandardOutput = true, WindowStyle = ProcessWindowStyle.Normal, UseShellExecute = false }; Process NewProcess = new Process(); NewProcess.StartInfo = StartInfo; if (NewProcess.Start()) { NewProcess.WaitForExit(); //ProcessOutput.Text = NewProcess.StandardOutput.ReadToEnd(); } } } }
Arguments = "args";
args
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)