Solved

creating folder issue

Posted on 2008-06-26
4
330 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

867 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now