private static void copy(string source,string dest) { System.Diagnostics.Process process = new System.Diagnostics.Process(); System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; startInfo.FileName = "powershell.exe"; //dest = @"D$\"; dest = dest.Remove(1, 1).Insert(1, "$"); dest = dest + "\\"; string server = "10.0.4.42"; string xx = "copy-item -path " + source + " \\\\" + server + "\\" + dest + " -Recurse -Force"; startInfo.Arguments = xx; //string ex = "exit"; //startInfo.Arguments = ex; startInfo.CreateNoWindow = true; startInfo.RedirectStandardInput = true; startInfo.RedirectStandardOutput = true; startInfo.UseShellExecute = false; process.StartInfo = startInfo; process.Start();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)