I am trying to create a function that copies a file or a folder and measures the copy time
public static TimeSpan CopyFileExplorer(string filePath, string fileDestination)
{
string command = @"/select, " + filePath;
System.Diagnostics.Process.Start("explorer.exe", command);
SendKeys.Send("^(C)");
command = @"/select, " + fileDestination;
System.Diagnostics.Process.Start("explorer.exe",command);
DateTime startCopy = DateTime.Now;
SendKeys.Send("^(V)");
//need to be catched when explorer finishes the copy
DateTime endCopy = DateTime.Now;
return endCopy - startCopy;
}
I have tried to find when the "copy window" of explorer disappears, but I didn't succeed...