private static string CreatePath(ServiceController controller, string path) { var isUnc = path.StartsWith(@"\\"); if (isUnc) { //no need to reformat return(path); } var machineName = controller.MachineName; var volume = path.Substring(0, 1); var folder = path.Substring(3); if (EnvHelper.IsLocalMachine(machineName)) { return($"{volume}:\\{folder}"); } return($"\\\\{machineName}\\{volume}$\\{folder}"); }