Hi
I am moving list of files from one directory to another directory.i am doing it by first moving all the files from the source directory to destination directory using filecopy command.then using rmdir command to remove the source directory..
the problem which i am facing is..
For example, i have two files in the directory named A and the size of the total dir is some 6.00kb. after deleting the files in the directory A i thought the directory size also becomes empty.but its showing 6.00kb eventhough no files are there in the deirectory.so i am getting an error
"file/path access error " while removing the directory using rmdir.
Anyone plz tell me how can i resolve this problem
Thanks in advance
Kalai
4 1631
Any chance you could post the existing code here, so we can see exactly what you've done so far? (Just the parts relevant to moving the files, that is).
(Also, I wonder whether Windows Indexing Service might be trying to update things and getting in the way.)
the necessary code is below...plz help me to delete the files and directory permanently.
Private Sub cmdDVD_Click()
dname = Dir1.Path
chcount = InStrRev(dname, "\")
dirname = Mid(dname, chcount + 1, Len(dname))
dpath = "c:\dvd\" & dirname
If Dir(dpath, vbDirectory) = vbNullString Then
MkDir dpath
End If
For fcount = 0 To File1.ListCount - 1
DirPath = Dir1.Path & "\" & File1.List(fcount)
dest = dpath & "\" & File1.List(fcount)
FileCopy DirPath, dest
'Kill DirPath
delete DirPath
Next fcount
RmDir Dir1.Path
MsgBox "archived in " & dpath
End Sub
thanks
Kalai
Is it possible that there are hidden files in the directory?
Another thing which comes to mind is that Windows XP often refuses to let you delete a directory because some program has it open. In this case, it might be your own program. Try changing the current directory, or the Path of your dir/file listboxes before doing the RmDir, so that nothing is referencing that directory.
As an example of what I mean, I've had cases where I opened a DOS window to go and delete some files (or view then, or whatever). Then in Explorer, I deleted everything in the folder, and tried to delete it. Windows wouldn't let me, because it was in use. I had to close the DOS window, or change its current directory, before I could do it.
P.S. Where are you seeing the 6 KB size after deleting the files? Maybe you just need to refresh something.
what u hve mentioned is correct.i changed the path of the dirlist before deleting.it works fine.
thank you very much.
Kalai
Is it possible that there are hidden files in the directory?
Another thing which comes to mind is that Windows XP often refuses to let you delete a directory because some program has it open. In this case, it might be your own program. Try changing the current directory, or the Path of your dir/file listboxes before doing the RmDir, so that nothing is referencing that directory.
As an example of what I mean, I've had cases where I opened a DOS window to go and delete some files (or view then, or whatever). Then in Explorer, I deleted everything in the folder, and tried to delete it. Windows wouldn't let me, because it was in use. I had to close the DOS window, or change its current directory, before I could do it.
P.S. Where are you seeing the 6 KB size after deleting the files? Maybe you just need to refresh something.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Guinness Mann |
last post by:
Greetings,
I can't figure out what to search on to find the documentation on how to
completely delete a "solution" from VS.NET 2003. I have no problem at
all deleting projects, but even if I...
|
by: Rosa |
last post by:
Hi,
I'm trying to clear the TIF on Windows XP programmatically with the
below code.
This code works fine on any folder but the TIF. For some reason the
atEnd() statements always defaults to true...
|
by: Martin Bischoff |
last post by:
Hi,
I'm creating temporary directories in my web app (e.g. ~/data/temp/temp123)
to allow users to upload files. When I later delete these directories (from
the code behind), the application...
|
by: osh.sean |
last post by:
I'm having a problem and I can't find anything about this anywhere else
out there.
I'm working on a solution that allows the end user to create folders /
upload files to the web server. Some...
|
by: Lee |
last post by:
Hi,
when deleting a directory using;-
string dir = "whatever";
Directory.Delete(dir);
it fails if files/directories exist within the directory being deleted. is
there an easy way of...
|
by: Sandeep Singh Sekhon |
last post by:
I am Developing a Web Application with ASP.NET 1.1
I have one project Folder which is virtual directory of IIS.
In this directory, I have one Folder named Photos in which I used to
Store Photos....
|
by: vikram.lakhotia |
last post by:
Hi
Have you tried deleting a directory in Asp.Net. Here is an article
discussing the problem deleting a Directory in Asp.Net
http://www.vikramlakhotia.com/Deleting_Directory_in_ASPnet_20.aspx...
|
by: Kimera.Kimera |
last post by:
I'm trying to write a program in VB.net 2003 that basically deletes all
files, folders, sub-folders and sub-sub folders (etc).
The program is simply for deleting the Windows/Temp folder contents,...
|
by: Nepomuk |
last post by:
Hi!
I want to have my program delete some folders including all contents. For that, I wrote this method:
private static void delete(String source)
{
File tmp = new File(source);...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |