static void DeleteTempCmdFile(OsProcess process, string cmdFilePath) { Action action = () => { process.WaitForExit(20000); File.Delete(cmdFilePath); }; action.BeginInvoke(null, null); }