diff --git a/SharpPrintNightmare/SharpPrintNightmare/Program.cs b/SharpPrintNightmare/SharpPrintNightmare/Program.cs index 2a7b7c9..8cdabdc 100644 --- a/SharpPrintNightmare/SharpPrintNightmare/Program.cs +++ b/SharpPrintNightmare/SharpPrintNightmare/Program.cs @@ -70,7 +70,10 @@ namespace SharpPrintNightmare dllpath = args[0]; if (dllpath.Contains("\\\\")) { - dllpath = dllpath.Replace("\\\\", "\\??\\UNC\\"); + // only replace the first occurence of \\\\ + string pattern = "\\\\"; + int position = dllpath.IndexOf("\\\\"); + dllpath = dllpath.Remove(position, pattern.Length).Insert(position, "\\??\\UNC\\"); } if (args.Length > 2)