473,549 Members | 2,543 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Directory.Delet e(path, true) raise an exception for non empty directories..

Hi over there,
What command should I run to delete folders even if theirs subfolders are
not empty with files ?????

Thanks in advance.
Nov 16 '05 #1
1 12938
genc ymeri wrote:
Hi over there,
What command should I run to delete folders even if theirs subfolders are
not empty with files ?????

Thanks in advance.


"subfolders are not empty with files" is not a problem of
"Directory.Dele te(..,true)".

"Directory.Dele te(..,true)" raises exception if some file/subfolder in
the folder cannot be deleted.

For example,
some files in the folder are marked as readonly,
some file/folder has been opened by other applications,
current user has no permission to delete the files/folders,
etc.

In such case, you shold catch the exception and prompt it to user to handle.

--
Jacky Kwok
ja***@alumni.cu hk.edu.hk
ja***@compose.c om.hk
Nov 16 '05 #2

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

Similar topics

9
6673
by: Jean-Marc Molina | last post by:
Hello, I can't find a way to execute a Windows application, whose directory path contains blank spaces, from a PHP script. I also wonder if the problem happens under Linux and other OS. Working dir : "C:\test copy" "copy.php" PHP script : <?php
3
3633
by: Kali K E | last post by:
Hi, I could not understand how I can do the following things in Python. Please help me. 1. First I have to find the current directory from where the script is invoked. 2. Next I have to form a directory structure there. If the current directory in step 1 is /home/mylogin, then from there I have to build a directory structure like...
3
2008
by: Zoool | last post by:
Hi, Is there a way to know the main directory path of a user session? I mean the "C:\Documents and Settings\username" Directory of the user logged into a windows session. In .NET you can do this with a : System.Environment.GetEnvironmentVariable("HOMEDRIVE") System.Environment.GetEnvironmentVariable("HOMEPATH") Maybe it's a stupid...
3
24936
by: Alan Howard | last post by:
Hi there, I can't seem to find any info on this error message that's generated when sending email with CDO: "The pickup directory path is required and was not specified" Does anyone know whether the cdoSMTPServerPickupDirectory field of the Message object defaults and whether it's normal to have to set this value explicitly. My W2K...
12
4093
by: cjw | last post by:
Pl help me with this simple question. I am using an array to store the file name, eg. char in = "filename.bmp"; How can I give the directory path with the file name?
5
25467
by: Vicky via DotNetMonster.com | last post by:
Please help to put directory path to app.config file! //DirectoryInfo di = new DirectoryInfo("C:\\Vicky Development\\FundExplorer\ \Index\\Copy of IntlIndex"); //string dipath = @"C:\Vicky Development\FundExplorer\Index\Copy of IntlIndex"; //DirectoryInfo di = new DirectoryInfo(dipath);
3
1538
by: kd | last post by:
Hi All, Given a full path name of a file, is there a command to extract the directory path (without the file name)? Thanks. kd
2
2248
by: enrique | last post by:
Hello everyone, I'm looking for a "directory path" solution that will allows me to test my app locally and then test on remote web server without having to update my web.config file each time I modify the file. In other words I'm storing the paths (for centralizing purposes) as custom <appSettings> in the web.config. expample (for local...
2
3016
by: WPW07 | last post by:
Hello, I have a script that lists the contents of a directory. It was working properly until we had to change the directory that it reads from. The path to this script is: /home/n/mu1/database/refresh.php.
0
7532
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...
0
7730
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7491
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7823
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5101
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...
0
3509
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1956
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
1
1068
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
776
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...

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.