Solved

creating folder issue

Posted on 2008-06-26
4
335 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month5 days, 21 hours left to enroll

627 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