public bool TryOpenExisting() { var processName = Path.GetFileNameWithoutExtension(_cmdLine); var proc = Process.GetProcessesByName(processName).FirstOrDefault(); if (proc != null) { _p = proc; return true; } return false; }