/// <summary> /// Resolves a mapped network drive into valid <b>UNC</b> path. /// </summary> /// <param name="path"></param> /// <returns> /// <b>UNC</b> path. /// </returns> public static string UncPathResolver(string path) { if (string.IsNullOrEmpty(path)) { throw new ArgumentNullException(nameof(path)); } if (Environment.OSVersion.Platform == PlatformID.MacOSX || Environment.OSVersion.Platform == PlatformID.Unix) { return(path); } if (IsNetworkDrive(path)) { return($"{RegistryOperations.GetCurrentUserKeyValue<string>($@"Network\\{path.ToUpperInvariant()[0]}", "RemotePath")}{path.Remove(0, 2)}"); } return(path); }