string fileAndPath = @"c:webserverpublicmyCompanyconfigspromo.xml"; string currentDirectory = Path.GetDirectoryName(fileAndPath); string fullPathOnly = Path.GetFullPath(currentDirectory);