Hello. I am trying to copy a directory with sub directories and files to another location on my computer. Whenever I try, I get the following error, through my "console":
The code that I am currently trying to execute is:
Any suggestions as to what I could do with "moving" the source directory? I just want to copy it...
VB.NET:
$>Error: System.IO.IOException: The directory is not empty.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive)
at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive)
at System.IO.Directory.Delete(String path)
at presets.mod_con.con_switch_1() in C:\Users\Administrator\Documents\Visual Studio 2010\Projects\presets\presets\mod_con.vb:line 6
The code that I am currently trying to execute is:
VB.NET:
Sub con_switch_1()
Try
Directory.Delete(vars.installDIR + "\Settings")
Directory.Move(Application.StartupPath + "\Preset1\Settings", vars.installDIR + "\Settings")
Form1.RichTextBox2.Text = Form1.RichTextBox2.Text + Environment.NewLine + "$>Controls successfully changed to Preset 1"
Catch ex As Exception
Form1.RichTextBox2.Text = Form1.RichTextBox2.Text + Environment.NewLine + "$>Error: " + ex.ToString
End Try
End Sub
Any suggestions as to what I could do with "moving" the source directory? I just want to copy it...