I am trying to rename a file on a network drive and I have found this:
I have found numerous links about this error. Unfortunately, it hasn't fixed my issue.
This is the code that I have tried:
var XMLFile = @"\ServerName\DriveName\NprintDevelopment\ExternalRequestsXML\";
var XMLOldExtension = "CallNPrintReport.processed";
var XMLNewExtension = "CallNPrintReport.reques";
if (File.Exists(XMLFile + XMLOldExtension))
{
File.Copy(XMLFile + XMLOldExtension, XMLFile + XMLNewExtension, false);
File.Delete(XMLFile + XMLOldExtension);
}
I also tried:
var XMLFile = "\\ServerName\\DriveName\\NprintDevelopment\\ExternalRequestsXML\\";
var XMLOldExtension = "CallNPrintReport.processed";
var XMLNewExtension = "CallNPrintReport.reques";
What am I missing? It is probably just something dumb but don't see the issue.