473,769 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3088
Pseudo code.......(hav en't tested it, but should work...... delete's the
file's first, then the folder)

<%
Dim FSO
Dim Fil
Dim Files

Set FSO = CreateObject("S cripting.FileSy stemObject")
'change Server.MapPath( "./") to the actual folder
Set Files = FSO.GetFolder(S erver.MapPath(" ./")).Files
For each fil in Files
FSO.DeleteFile fil
Next
'change Server.MapPath( "./") to the actual folder
FSO.DeleteFolde r(Server.MapPat h("./"))

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.goo gle.com...
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\Ser ver"
Server.CreateOb ject("WScript.S hell").Run "cmd.exe /c rd """ & sPath & """ /s
/q", 0

Ray at home

"tvr" <tv*****@yahoo. com> wrote in message
news:6f******** *************** ***@posting.goo gle.com...
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
2560
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 the created records in the database and I don't want to lose all that info when I rename a file and synchronise, I've added some code to the program. It works like this: when the filename of a DB records
1
1407
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 of my project and A2 is the name of my subdirectory. It looks like the program is looking for the bin folder in the subdirectory, not the root directory; I know this because if I copy the bin directory from the root directory to the subdirectory,...
5
3059
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 me. (I don't use ASP.NET or any web service at all, only windows forms). Here is how I work : I have a solution with 10 projects inside. Each of them is built in a different directory (MyProject/bin/debug for each project). I have then a...
12
8018
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 File.Delete(Filename) Next Catch ex As Exception
5
2396
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 and subdirectories are actually deleted, but the leaf subdirectories in the tree remain "locked" (they are not accessible anymore by the webapp or by Windows Explorer) until the webapp ends. When the web app is ended, the leaf subdirectories...
0
2666
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 "C:\TestDelete\Sub1". I have Windows Explorer open and I have "Sub1" selected in the tree view. There are no files in any of the directories and none are read-only. If I then call: Directory.Delete(@"C:\TestDelete", true); // recursive delete
7
4222
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) File.Delete(L3Global.VideoFileName) ' The following is not working - reports directory not empty exception ' Directory.Delete(fDir)
8
13207
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 compiles & runs fine locally, but when I copy to the production machine, I get this error: Parser Error Message: Could not load type 'Global'. Source Error: Line 1: <%@ Application Codebehind="Global.asax.vb" Inherits="Global" %> Source...
3
10302
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 on my local IIS 5.1 server (on WinXP SP2), records get deleted without any problems but when I upload the same file (which has the above DELETE query) to the actual remote server, then
3
2072
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 obtain Exception Details: System.UnauthorizedAccessException: Access to the path '***' is denied.
0
9590
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9424
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10051
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8879
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.