var path = "C:\Program Files\Test1\Test2\Test3\Test4";
var pathItems = path.Split('\');
var paths = new List<string>();
for(var i = 0; i < pathItems.Length; i++)
{
var items = pathItems.Skip(0).Take(i+1).ToArray();
paths.Add(string.Join(@"\", items);
}
The following paths are then contained in the variable "paths".
1.C:\
2.C:\Program Files\
3.C:\Program Files\Test1\
4.C:\Program Files\Test1\Test2\
5.C:\Program Files\Test1\Test2\Test3\
6.C:\Program Files\Test1\Test2\Test3\Test4