---
title: "Server.MapPath to go two folder back from root"  
description: "Server.MapPath to go two folder back from root"  
author: "Anonymous User"  
published: 2018-05-28  
updated: 2018-05-28  
canonical: https://www.mindstick.com/forum/34496/server-mappath-to-go-two-folder-back-from-root  
category: "c#"  
tags: ["c#", ".net"]  
reading_time: 1 minute  

---

# Server.MapPath to go two folder back from root

this I have done

```
HttpContext.Current.Server.MapPath(@"~\~\~\Content\")
```

I want to go two folder back from the [root](https://answers.mindstick.com/qa/49855/tell-me-what-is-root-port-in-spanning-tree-protocol)

## Replies

### Reply by Anonymous User

If you really need the grandparent path, you can get it from the root path using Path.GetDirectoryName():

```
string root = Server.MapPath("~");
string parent = Path.GetDirectoryName(root);
string grandParent = Path.GetDirectoryName(parent);
```

hope it resolves your problem


---

Original Source: https://www.mindstick.com/forum/34496/server-mappath-to-go-two-folder-back-from-root

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
