private string GetRenamePath(string existingPath, string newName) { if (!existingPath.Contains("\\")) return newName; return existingPath.Substring(0, 1+existingPath.LastIndexOf('\\')) + newName; }