may be text.exe is open in task manager see the process is open or not
if open you write the code below to stop the process
Process[] processes = Process.GetProcessesByName("test.exe");
if (processes.Length > 0)
processes[0].CloseMainWindow();
and then write your code to copy the file