VB6 Error Permission denied run-time error 70

why am i getting this error when I try to delete the folder when the folder is empty
VB6 Error Permission denied run-time error 70

If fso.FolderExists("C:\tmp_email\messages") Then
   fso.DeleteFolder ("C:\tmp_email\messages")
End If
1030071002Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

krishrrCommented:
Please reply the following to find the right solution for you.

1. Are you able to delete that folder manually?
2. What OS you are using?
3. In which login, you tried to delete the folder? With admin rights or restricted access?

Note:
Suppose the folder is created in admin login, and with user login if you try to delete, you will find this issue. First make sure you ve full rights to the folder.

Try creating new folder and then try to delete the same folder in your code.
OR
Change the Drive C to some other and try because in some systems there may be restriction to access C drive.






0
1030071002Author Commented:
1 no
2 xp PROFESSIONAL
ADMIN RIGHTS i DO HAVE FULL RIGHTS
0
nirojexpertCommented:
have you checked if the folder is not empty. if there are files in it you may not be able to delete the folder.
and also, if you have opened any file from that folder and if it is not closed, you cannot delete that folder.
perhaps temp/messages has files which are open by the mail program
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.