Solved

creating folder issue

Posted on 2008-06-26
4
331 Views
Last Modified: 2011-10-19
I am getting following message

Could not complete operation on some files and directories. See the Data property of the exception for more details

On this line of VB code

check code attached!
My.Computer.FileSystem.CopyDirectory(Application.StartupPath + "\folder\", "" & Me.FolderBrowserDialog1.SelectedPath.ToString + "\folder1\test\" & "")

Open in new window

0
Comment
Question by:CalmSoul
  • 2
4 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 21881254
Can you give us more information about the error ?

Try
  My.Computer.FileSystem.CopyDirectory(Application.StartupPath + "\folder\", "" & Me.FolderBrowserDialog1.SelectedPath.ToString + "\folder1\test\" & "")
catch ex as exception
  messagebox.show ex.tostring()
end try
0
 
LVL 48

Expert Comment

by:jpaulino
ID: 21882414
Do you have files in use (open) ?
0
 
LVL 5

Author Comment

by:CalmSoul
ID: 21883432
here is detailed error
error-1.jpg
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 500 total points
ID: 21883542
Try this way:
Dim str As String = Me.FolderBrowserDialog1.SelectedPath.ToString + "\folder1\test\"
My.Computer.FileSystem.CopyDirectory(Application.StartupPath + "\folder\", str)

Also check if the destination path exists using If IO.Directory.Exists(str) then ...
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal reports vb.net 2 39
Regex validation 2 24
Disable extension 8 37
Firing an ASP.NET event on selection of a JQuery datepicker 4 12
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question