string path = "D:\\test\\test1\\demo"; Directory.SetCurrentDirectory(Directory.GetParent(path).FullName); string parentPath = Directory.GetCurrentDirectory();//parentPath = D:\\test\\test1