Could not delete a directory

T

tvr

Hi,

I have a strange problem.
I am not able to delete a published folder.
Any ideas??

The files in the folder are not open, but it still
says that "Please make sure files ...."

I am working on windows 2000 Advanced server with IIS 5.

Thanks
tvr
 
S

Steven Burn

Pseudo code.......(haven't tested it, but should work...... delete's the
file's first, then the folder)

<%
Dim FSO
Dim Fil
Dim Files

Set FSO = CreateObject("Scripting.FileSystemObject")
'change Server.MapPath("./") to the actual folder
Set Files = FSO.GetFolder(Server.MapPath("./")).Files
For each fil in Files
FSO.DeleteFile fil
Next
'change Server.MapPath("./") to the actual folder
FSO.DeleteFolder(Server.MapPath("./"))

Set FSO = Nothing
Set Fil = Nothing
Set Files = Nothing
%>

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
R

Ray at

To do it all in one swoop, you could try:
sPath = "C:\Path\On\Server"
Server.CreateObject("WScript.Shell").Run "cmd.exe /c rd """ & sPath & """ /s
/q", 0

Ray at home
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,141
Messages
2,570,814
Members
47,357
Latest member
sitele8746

Latest Threads

Top