473,324 Members | 2,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Could not delete a directory

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
Jul 19 '05 #1
2 3063
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)
tvr <tv*****@yahoo.com> wrote in message
news:6f**************************@posting.google.c om...
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

Jul 19 '05 #2
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

"tvr" <tv*****@yahoo.com> wrote in message
news:6f**************************@posting.google.c om...
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

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Koen | last post by:
Hi all, I created a little database to manage my e-books. The program will synchronize a table with the contents of a directory. Works great. Because I keep additional info (like keywords) to...
1
by: Sumit Thomas | last post by:
Hi, I have created sub directories for my application, however, when I try to access the aspx files in the subdirectory, I get the following error : "Could Not Load A1.A2" where A1 is the name...
5
by: Verane | last post by:
Hi, I have read the thread named "Could not copy temporary files to the output directory" on this newsgroup. And I have the same symptoms on my machine. But I didn't find any solution suitable for...
12
by: Lucas Tam | last post by:
I have a very simple loop: If (Directory.Exists(tempDirectory)) Then Try Dim Files() As String = Directory.GetFiles(tempDirectory) 'Clear out directory For Each Filename As String In Files...
5
by: Olivier GIL | last post by:
Hello, The method Directory.Delete(path, true) of .NET 2.0 called from within a web app does not work correctly if the initial directory is not empty : all the files inside the root directory...
0
by: Terry | last post by:
In short, I'm getting an IOException "Directory is not empty" if I have a Windows Explorer window open and have a subdirectory selected in the tree view. For example, I have a directory path of...
7
by: Anil Gupte | last post by:
Private Sub mnu2Exit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnu2Exit.Click Dim fDir As String = Path.GetDirectoryName(L3Global.VideoFileName) ...
8
by: Rob T | last post by:
When I was using VS2003, I was able to compile my asp.net project locally on my machine and copy it to the production server and it would run just fine. I've now converted to VS2005. The project...
3
by: rn5a | last post by:
I am trying to delete records from a MS-Access DB table using the following query: strSQL=DELETE FROM MyTable WHERE =CInt(Request.QueryString("delete")) con.Execute strSQL When I run the app...
3
by: Steph | last post by:
hello, i ve a probleme when deleting a directory and when i want create file immediatly after. 1) Directory.Delete(myPath, true); 2) TextWriter sw = new StreamWriter(myPath +"test.aspx"); i...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.