Link to home
Start Free TrialLog in
Avatar of OblivionSY
OblivionSY

asked on

FSO.DeleteFolder Permission Error

I have a script which can create a folder and add a file into this folder, this works fine. But i need to have another script to reverse this, ie delete this folder and the file inside.

I have used the FSO.DeleteFolder(Server.MapPath(MyFolder), True) to remove the folder, (and as i understand all files in the folder) however, i get a "Permission Denied" error. Presumably i need to give access rights to the script so it can delete folders. How can this be done?

Avatar of Slimshaneey
Slimshaneey
Flag of United Kingdom of Great Britain and Northern Ireland image

In the parent folder, you need to give IUSR_machinename rights over all files and folders in that direxctory. You should then be able to delete...
Avatar of OblivionSY
OblivionSY

ASKER

How does one go about doing that? It will need to work from multiple machines too.
On the machine it self, go to the parent folder. Right click it, select properties, then Security, there is a list of users. You will need then to add IUSR_whetverthenameofyourmachineis to that list and give all nescessary rights to that folder and its contents,
Ahhh, one thing i should have said is, i dont host the pages, they are on a webserver somewhere. So i cannot access that information.

Is there any way for the dynamically created folders to be dynamically deleted?

 When the folder is created, is there anyway to set the permissions then that anyone can delete it?
ASKER CERTIFIED SOLUTION
Avatar of Slimshaneey
Slimshaneey
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you may get that error if the resource used by the file is not destroyed properly