PC Review


Reply
Thread Tools Rate Thread

Deleting folders in Documents and Settings

 
 
Jonas
Guest
Posts: n/a
 
      7th Dec 2005
Hi.

I am trying to delete unused user profiles, but i am not able to do this. I
think it has something to do with the SpecialFolder attribute? Does anyone
know how to delete files and folder under "Documents and Settings"
DirectoryInfo di = new DirectoryInfo(@"C:\Documents and Settings\Username");

di.Delete(true);


 
Reply With Quote
 
 
 
 
TerryFei
Guest
Posts: n/a
 
      8th Dec 2005
Hi,
Welcome to MSDN Newsgroup!

From my experience, this operation will need admin privilege. So please
help us confirm whether or not current user account owns admin privilege.
If not, you could use an admin account to log on and try this again.

If you have any questions or concerns, please let me know. I am standing by
to help you. Thanks again and have a nice day!

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
Jonas
Guest
Posts: n/a
 
      8th Dec 2005
Hi Terry.

The operation is done with local admin privileges.
""TerryFei"" <v-(E-Mail Removed)> wrote in message
news:efxymg8%(E-Mail Removed)...
> Hi,
> Welcome to MSDN Newsgroup!
>
> From my experience, this operation will need admin privilege. So please
> help us confirm whether or not current user account owns admin privilege.
> If not, you could use an admin account to log on and try this again.
>
> If you have any questions or concerns, please let me know. I am standing
> by
> to help you. Thanks again and have a nice day!
>
> Best Regards,
>
> Terry Fei[MSFT]
> Microsoft Community Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>



 
Reply With Quote
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      9th Dec 2005
Hi Jonas,

You're getting an exception which says access denied, because there are
some read-only folders and files under the user's folder. Unlike deleting
in the windows UI, the Delete method cannot handle the files that are
read-only. So you have to make them writable first.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
Reply With Quote
 
Jonas
Guest
Posts: n/a
 
      9th Dec 2005
Thank you Kevin, you solved my problem.
"Kevin Yu [MSFT]" <v-(E-Mail Removed)> wrote in message
news:d91L1$I$(E-Mail Removed)...
> Hi Jonas,
>
> You're getting an exception which says access denied, because there are
> some read-only folders and files under the user's folder. Unlike deleting
> in the windows UI, the Delete method cannot handle the files that are
> read-only. So you have to make them writable first.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>



 
Reply With Quote
 
Kevin Yu [MSFT]
Guest
Posts: n/a
 
      10th Dec 2005
You're welcome, Jonas.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Deleting user folders under documents and settings. Steven Jablonski Microsoft Windows 2000 Terminal Server Applications 5 13th Jan 2011 10:12 AM
Trouble deleting Old Profiel Folders from Documents and settings. =?Utf-8?B?TEJT?= Windows XP Help 8 3rd May 2005 08:11 PM
Deleting folders under Documents and Settings =?Utf-8?B?ZW1tZWZm?= Windows XP Configuration 2 14th Dec 2004 12:39 PM
Re: Deleting Documents and Settings folders Thorsten Matzner Windows XP Basics 0 23rd Jun 2004 04:48 PM
accessing the documents and settings folders and other folders in my home networ apex75@sbcglobal.net Windows XP Basics 7 22nd Apr 2004 07:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:08 AM.