I have an issue deleting a Virtual Directory from IIS 5.0. I'm up to date on Win2k service packs

The issue is this. I delete and IIS App and Virtual Directory from IIS Metabase with you issues by calling the following from VBScript in ASP page using ADSI objects
oVirtualDirectory.AppUnloa
owwwRoot.Delete "IISWebVirtualDir", gVirtualDirectoryNam

When I then use FileSystemObject to delete the folder, I can delete all files and sub folders but the delete of the main folder results on a Permission Denied error because the folder is being used by someone else. When I restart IIS I can then delete the folder. So, I'm assuming that IIS has a hold on the folder resource still. I know that in MMC you can delete everything in one shot so I must be able to from VBScript as well. Resetting IIS is not an option for me in this case and just leaving the file seems to be bad form

Thanks
- Lester

Re: Delete Virtual Directory by Frank

Frank
Mon Jan 12 20:03:00 CST 2004

Try stop the virtual server using ADSI and see if it helps

"Lester" <anonymous@discussions.microsoft.com> wrote in message
news:666BACA6-C114-4CAA-B00D-106EBF18C83B@microsoft.com...
> I have an issue deleting a Virtual Directory from IIS 5.0. I'm up to date
on Win2k service packs.
>
> The issue is this. I delete and IIS App and Virtual Directory from IIS
Metabase with you issues by calling the following from VBScript in ASP page
using ADSI objects:
> oVirtualDirectory.AppUnload
> owwwRoot.Delete "IISWebVirtualDir", gVirtualDirectoryName
>
> When I then use FileSystemObject to delete the folder, I can delete all
files and sub folders but the delete of the main folder results on a
Permission Denied error because the folder is being used by someone else.
When I restart IIS I can then delete the folder. So, I'm assuming that IIS
has a hold on the folder resource still. I know that in MMC you can delete
everything in one shot so I must be able to from VBScript as well.
Resetting IIS is not an option for me in this case and just leaving the file
seems to be bad form.
>
> Thanks,
> - Lester



Re: Delete Virtual Directory by anonymous

anonymous
Tue Jan 13 13:01:31 CST 2004

I haven't tried stopping the Virtual Server but I fear that this won't get me to where I need to go. We have multiple running applications under the one virtual server. So, stopping the virtual server is as good as restarting IIS for me. Meaning, all of my current user sessions and such will be reset which is worse than just leaving an empty directory on the server

I'll keep searching. Again, the MMC can do it so there must be a way....