title: Copy folder in visual basic
body: <p>I'am trying to copy a folder from a textbox a user specify to another location a user specify but this code only copies the file to the destination and not the folder. I'am using Visual Studio 2005.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>    Dim strDate As String
      strDate = DateTime.Now.ToString("yyyy-MM-dd")
  
      Dim sFolderpath
      Dim dFolderpath
      Dim fs
  
      fs = CreateObject("Scripting.FileSystemObject")
      sFolderpath = TextBox1.Text
      dFolderpath = TextBox6.Text + "\"
      fs.createfolder(dFolderpath &amp; strDate)
      fs.copyfolder(sFolderpath, dFolderpath &amp; strDate)
  </code></pre>
  
  <ul>
  <li>First the script create a folder in a destination specified by the user in textbox1
  and name it after todays date</li>
  <li>Then I would like to copy a folder from a destination specified by the user in textbox6</li>
  </ul>
  
  <p>It only copies the files to the destination not the folder itself. 
  Value in textbox1 = C:\Test\Test2.
  Value in textbox6 = K:\Backup</p>
  
  <p>Please help!</p>