Solved

creating folder issue

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
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…
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…
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…

708 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

19 Experts available now in Live!

Get 1:1 Help Now