string path = Path.GetDirectoryName(@"D:\Program Files\abc.exe");
string str="D:\\Program Files\\abc.exe";str.substring(0,sstrLastIndexOf('\'))