October 28th, 2004, 10:29 AM
A VB6 problem and strange thing
Hello, I am using WinXP Home. I am creating an application in VB6 and this is my problem:
There is an sample folder with a file that I created.
Let it be C:\folder\file.txt
Then I run the command
The problem is that only the file is removed, the folder stays there. Also why is that all the folders in my computer is set to read-only attribute (when I check the properties of the folder, the Read-only attribute is checked and the box "appeared" to be disabled althought not).
Then I code another app with only the rmdir command and it did remove the directory.
Can anyone help me out...
October 28th, 2004, 12:01 PM
works perfictly fine for me .................what is the error message you are getting ?.......and are you sure the folder is empty?
I had like 5 -6 txt files in this test123 folder and this code delete all the files then the folder itse;f
Private Sub Command1_Click()
October 28th, 2004, 12:23 PM
Opps. I forgot to say that I have set the attributes of the file to Read-only, and the folder to all 4 attributes using setattr. Then when I want to remove the file and the folder, I first use setattr "C:\folder\file.txt", vbnormal followed by setattr "C:\folder\file.txt", vbnormal. Then I kill the file and remove the folder. The folder is named such that it include an "extension", such as folder.exe
There is no other files in the folder other than the one that I already issued the kill command.
There is an error while it is trying to remove the folder: Path/File access error
After this error occured, the file is removed (which is correct), but the folder is still there when I checked...
November 1st, 2004, 03:30 PM
I found a fix to my own problem :P
After I "kill" the file, I use a do while loop...
Do While Dir$(path of the file inside the folder) = vbNullString
RmDir (folder path)
Strangely, after I added this loop it solved my problem.
February 4th, 2005, 08:32 PM
February 4th, 2005, 08:36 PM
did u buy your copy of vb6, if u didnt plz can u tell me where u got it from, im desperate 2 try it. I have.