title: Why I am getting "The given path's format is not supported" error
body: <p>I am unable to rename a file located in (D drive) using c#. I am getting the error </p>
  
  <blockquote>
    <p>Exception Details: System.NotSupportedException: The given path's
    format is not supported.</p>
  </blockquote>
  
  <p>every time.</p>
  
  <p>I am using </p>
  
  <pre><code>string oldfilename = @"D:\abc\file.txt";
  string newfilename = @"D:\abc\tree.txt";
  System.IO.File.Move(oldfilename, newfilename);
  </code></pre>
  
  <p>but I am getting the error on the last line.
  I also tried changing the first 2 lines to</p>
  
  <pre><code>string oldfilename = "D:\\abc\\file.txt";
  string newfilename = "D:\\abc\\tree.txt";
  </code></pre>
  
  <p>I also ensured that the file "file.txt" exists. Tried to use different location.</p>
  
  <p>I also tried Reading contents of the file.txt, but I am getting same error.
  I searched all the Questions on SO, But with no luck I could get this issue resolved. I think there is some issue with the ":" that I am using after the drive letter while specifying the path. Please guide me.</p>