title: System.IO.DirectoryNotFoundException by File.Move
body: <p>Just a quick question (I hope):
  When I use File.Move it gives me an error:</p>
  
  <pre><code>System.IO.DirectoryNotFoundException was unhandled by user code
    Message=Could not find a part of the path.
    Source=mscorlib
    StackTrace:
         at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
         at System.IO.__Error.WinIOError()
         at System.IO.File.Move(String sourceFileName, String destFileName)
         at Portal_2_Level_Installer.Form1.WorkMagic(String FileLocation) in C:\Users\Yoshie\Local Settings\Documents\Visual Studio 2010\Projects\Portal 2 Level Installer\Portal 2 Level Installer\Form1.cs:line 265
    InnerException: 
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>File.Move(FileLocation, destinationPath);
  </code></pre>
  
  <p>And the contents of the variables:</p>
  
  <pre><code>destinationPath="c:/program files (x86)/steam\\steamapps\\common\\portal 2\\Test\\Test.docx"
  FileLocation="C:\\Users\\Yoshie\\Local Settings\\Documents\\Test.docx"
  </code></pre>
  
  <p>Thanks!
  EDIT: I really feel like an idiot now. I didn't realise that the destination folder had to exist! I stupidly assumed that the destination folder would be automatically created if it didn't already exist. Sorry for wasting your time, but thanks for the answers anyway! (I now know that I can use @ to stop escaping, so thats good to know)
  Thanks anyway, and again, sorry!</p>