Solved

creating folder issue

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Upgrading my SSIS package in VS 2012 6 83
Easy filter aspnet 2 34
Amazon S3 Images with .Net 3 29
Visual Studio npm 1 29
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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

679 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