473,396 Members | 2,013 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,396 software developers and data experts.

delete folders, subfolders and files (some maybe read only or hidden)

Hi All,
I have seen many examples of deleting folders with subfolders and files.
(system.io.directory/info etc delete method)
However, I cannot find a decent code example which will work where some
folders/files maybe read only or hidden. I know, basically have to change
the file attributes to normal.
Has anyone a good example of a URL for a good example?
Cheers,
Pete Gomersall
Nov 17 '05 #1
3 2864
Pete Gomersall wrote:
Hi All,
I have seen many examples of deleting folders with subfolders and files.
(system.io.directory/info etc delete method)
However, I cannot find a decent code example which will work where some
folders/files maybe read only or hidden. I know, basically have to change
the file attributes to normal.
Has anyone a good example of a URL for a good example?
Cheers,
Pete Gomersall


Why? Is it so hard to write it your selfe
Nov 17 '05 #2
Did u try setattributes and getattributes of System.IO.File and
System.IO.Directory.....If you want samples you can take those keywords
and search in google
-------
Regards ,
C#, VB.NET , SQL SERVER , UML , DESIGN Patterns Interview question book
http://www.geocities.com/dotnetinterviews/
My Interview Blog
http://spaces.msn.com/members/dotnetinterviews/

Nov 17 '05 #3
http://msdn.microsoft.com/library/de...rfsystemio.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.

"Pete Gomersall" <pe************@nau.edu> wrote in message
news:OE**************@tk2msftngp13.phx.gbl...
Hi All,
I have seen many examples of deleting folders with subfolders and files.
(system.io.directory/info etc delete method)
However, I cannot find a decent code example which will work where some
folders/files maybe read only or hidden. I know, basically have to change
the file attributes to normal.
Has anyone a good example of a URL for a good example?
Cheers,
Pete Gomersall

Nov 17 '05 #4

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

Similar topics

11
by: Ben | last post by:
Greetings, I am looking for a way to search for and delete files based on a pattern mask. For example, the search method would find all files matching a certain pattern containing wildcards (e.g....
2
by: laura | last post by:
I am writing an intranet and want to be able to hyperlink to all files within a specific folder AND it's subfolders. Whilst I can hyperlink to the files in the specified folder AND I can also...
3
by: Web Webon | last post by:
Hi everybody! I wonder if this is possible? I need to determine if a client is using "windows classic folders" or anything else. If I instantiate a Shell ActiveX object is there a way of...
1
by: genc ymeri | last post by:
Hi over there, What command should I run to delete folders even if theirs subfolders are not empty with files ????? Thanks in advance.
2
by: Philip Wagenaar | last post by:
How do I search for a directory on a windows xp machine and delete the directory including all subfolders and files in them?
9
by: Paul | last post by:
I'm trying to make get my app to delete all the files in a specified folder and all the files within the folders of the specified folder. e.g. Folder 1 contains three files (File1, File2, File3)...
1
by: Øyvind Isaksen | last post by:
I try to find som information about creating folders (and subfolders) on the webserver using asp.net (1.0). I have made a filuploader, and all files are now saved in the same folder on the...
7
by: Brian Cahill | last post by:
Hi, I am attempting to delete Profile folders from C:\Documents and Settings\. I am receiving a Permission denied error when using the Directory.Delete method. Here is my code. Is there any...
0
MMcCarthy
by: MMcCarthy | last post by:
This is a module that scans for files and folders on a specified path and describe them in comma separated values file in a text format. The information is stored in this file consecutively like:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.