Welcome to WinForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Removing read only attributes on folders

 
   Windows XP Arc2 (Home) -> Security Admin RSS
Next:  local groups and NTFS Persmissions  
Author Message
ram11

External


Since: Nov 08, 2004
Posts: 10



(Msg. 1) Posted: Mon Jul 24, 2006 4:49 am
Post subject: Removing read only attributes on folders
Archived from groups: microsoft>public>windowsxp>security_admin (more info?)

Hi,
Though I was able to change the file attributes, I was unable to change the
folder attributes through the below command.Please suggest on this.

attrib -r -s "C:\Documents and Settings\ITQA\My Documents\*" /s /d

Regards
Ram

 >> Stay informed about: Removing read only attributes on folders 
Back to top
Login to vote
Wesley Vogel

External


Since: Feb 23, 2004
Posts: 2350



(Msg. 2) Posted: Mon Jul 24, 2006 2:55 pm
Post subject: Re: Removing read only attributes on folders [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Folders cannot be read-only, only files can be read-only.

Folder Read-only attribute
[[Specifies whether the files in this folder are read-only, which means that
they cannot be changed or accidentally deleted.

For multiple folders, if you select this check box all of the files in the
folders will be read-only. If you clear the check box, none of the files in
the selected folders will be read-only.]]

The Read-only attribute that you see in folder Properties has nothing to do
with any of the folders themselves.

There is nothing to remove.

If you keep messing around you'll be back asking; One of my special folders
(e.g. My Documents) has lost its name, lost its icon, or has the wrong Task
Pane template, how can I get it back?

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In news:E1364D37-5C34-439E-8EA7-CDF852824CD5@microsoft.com,
Ram <Ram.RemoveThis@discussions.microsoft.com> hunted and pecked:
> Hi,
> Though I was able to change the file attributes, I was unable to change
> the folder attributes through the below command.Please suggest on this.
>
> attrib -r -s "C:\Documents and Settings\ITQA\My Documents\*" /s /d
>
> Regards
> Ram

 >> Stay informed about: Removing read only attributes on folders 
Back to top
Login to vote
ram11

External


Since: Nov 08, 2004
Posts: 10



(Msg. 3) Posted: Mon Jul 24, 2006 10:59 pm
Post subject: Re: Removing read only attributes on folders [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Wesley,
As part of our requirement, we are needed to delete all the folders and
files from ‘My documents’ folder after each exit of our application. But we
are facing the below error .

“Access to the path 'C: \Documents and Settings\Administrator\My
Documents\Test Project' is denied.”

This is the VB.net code we are trying to implement. Please suggest on the
same.

Regards
Ram
---------------------------------------------------------------------------------------------
string strPath = "C:\\Documents and Settings\\Administrator\\My
Documents\\TestProject";

string[] s =System.IO.Directory.GetDirectories(strPath);


try
{
for (int i = 0; i < Convert.ToInt32(s.Length); i++)
{



System.IO.Directory.Delete(s[i], true);
}
}
catch (IOException ex)
{
MessageBox.Show(ex.ToString());
}

string strPath1 = "C:\\Documents and Settings\\Administrator\\My
Documents\\TestProject";


System.IO.File.Delete(strPath1);


-------------------------------------------------------------------------------------------


"Wesley Vogel" wrote:

> Folders cannot be read-only, only files can be read-only.
>
> Folder Read-only attribute
> [[Specifies whether the files in this folder are read-only, which means that
> they cannot be changed or accidentally deleted.
>
> For multiple folders, if you select this check box all of the files in the
> folders will be read-only. If you clear the check box, none of the files in
> the selected folders will be read-only.]]
>
> The Read-only attribute that you see in folder Properties has nothing to do
> with any of the folders themselves.
>
> There is nothing to remove.
>
> If you keep messing around you'll be back asking; One of my special folders
> (e.g. My Documents) has lost its name, lost its icon, or has the wrong Task
> Pane template, how can I get it back?
>
> --
> Hope this helps. Let us know.
>
> Wes
> MS-MVP Windows Shell/User
>
> In news:E1364D37-5C34-439E-8EA7-CDF852824CD5@microsoft.com,
> Ram <Ram RemoveThis @discussions.microsoft.com> hunted and pecked:
> > Hi,
> > Though I was able to change the file attributes, I was unable to change
> > the folder attributes through the below command.Please suggest on this.
> >
> > attrib -r -s "C:\Documents and Settings\ITQA\My Documents\*" /s /d
> >
> > Regards
> > Ram
>
>
 >> Stay informed about: Removing read only attributes on folders 
Back to top
Login to vote
Kerry Brown

External


Since: May 08, 2005
Posts: 719



(Msg. 4) Posted: Tue Jul 25, 2006 7:36 am
Post subject: Re: Removing read only attributes on folders [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

A few thoughts

1) In the error message Test Project has a space in it. In the code it
doesn't. Is this just a typo in your post?

2) Is the program running as the administrator account?

3) Are the files deleted and not the folder or is nothing deleted?

--
Kerry
MS-MVP Windows - Shell/User
www.VistaHelp.ca

Ram wrote:
> Hi Wesley,
> As part of our requirement, we are needed to delete all the folders
> and files from 'My documents' folder after each exit of our
> application. But we are facing the below error .
>
> "Access to the path 'C: \Documents and Settings\Administrator\My
> Documents\Test Project' is denied."
>
> This is the VB.net code we are trying to implement. Please suggest on
> the same.
>
> Regards
> Ram
> ---------------------------------------------------------------------------------------------
> string strPath = "C:\\Documents and Settings\\Administrator\\My
> Documents\\TestProject";
>
> string[] s =System.IO.Directory.GetDirectories(strPath);
>
>
> try
> {
> for (int i = 0; i < Convert.ToInt32(s.Length); i++)
> {
>
>
>
> System.IO.Directory.Delete(s[i], true);
> }
> }
> catch (IOException ex)
> {
> MessageBox.Show(ex.ToString());
> }
>
> string strPath1 = "C:\\Documents and
> Settings\\Administrator\\My Documents\\TestProject";
>
>
> System.IO.File.Delete(strPath1);
>
>
> -------------------------------------------------------------------------------------------
>
>
> "Wesley Vogel" wrote:
>
>> Folders cannot be read-only, only files can be read-only.
>>
>> Folder Read-only attribute
>> [[Specifies whether the files in this folder are read-only, which
>> means that they cannot be changed or accidentally deleted.
>>
>> For multiple folders, if you select this check box all of the files
>> in the folders will be read-only. If you clear the check box, none
>> of the files in the selected folders will be read-only.]]
>>
>> The Read-only attribute that you see in folder Properties has
>> nothing to do with any of the folders themselves.
>>
>> There is nothing to remove.
>>
>> If you keep messing around you'll be back asking; One of my special
>> folders (e.g. My Documents) has lost its name, lost its icon, or has
>> the wrong Task Pane template, how can I get it back?
>>
>> --
>> Hope this helps. Let us know.
>>
>> Wes
>> MS-MVP Windows Shell/User
>>
>> In news:E1364D37-5C34-439E-8EA7-CDF852824CD5@microsoft.com,
>> Ram <Ram.DeleteThis@discussions.microsoft.com> hunted and pecked:
>>> Hi,
>>> Though I was able to change the file attributes, I was unable to
>>> change the folder attributes through the below command.Please
>>> suggest on this.
>>>
>>> attrib -r -s "C:\Documents and Settings\ITQA\My Documents\*" /s /d
>>>
>>> Regards
>>> Ram
 >> Stay informed about: Removing read only attributes on folders 
Back to top
Login to vote
ram11

External


Since: Nov 08, 2004
Posts: 10



(Msg. 5) Posted: Tue Jul 25, 2006 11:09 pm
Post subject: Re: Removing read only attributes on folders [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Kerry,

1) In the error message Test Project has a space in it. In the code it
doesn't. Is this just a typo in your post? : Yes.There is no space between
testproject in either of them.

2) Is the program running as the administrator account? Yes

3) Are the files deleted and not the folder or is nothing deleted?

All the folders, and the files in those folders are being deleted. But not
files with in Testproject.In the code we are assuming Testproject as 'My
documents'.This is because we have some system files in 'My Documents'.

Testproject (folder)
-> folder f1 (deleted)
-> folder f2 and files a1,a1 in f2 (deleted)
-> file b1, b2 in Testproject (Not being deleted)


Hi Wesley,

All the settings in 'User Rights Assignment' of local security policy are
default and the machine is in work group.

Regards
Ram
 >> Stay informed about: Removing read only attributes on folders 
Back to top
Login to vote
David Schrader

External


Since: May 15, 2006
Posts: 1



(Msg. 6) Posted: Wed Jul 26, 2006 11:49 am
Post subject: Re: Removing read only attributes on folders [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Odd as it may sound, there ARE ways of changing
all of the Folder (which IS a File) attributes including
the "read" attribute.

Unfortunately Microsoft has *never* seen fit make
the effort of implementing that level of file (sic)
security/operability/functionality. I had hoped,
when they implemented the NTFS system that
their "vision" might include that foresight. Sadly
their scope wasn't quite that visionary.

It would be nice to be able to place an ACL on
any Drive/Directory/Sub-Directory/File/or/
File.Version and know that it would work.

Another AC that would be nice to have would
be an (E)xecute "control" that was independent
from the current "ReadExecute" option. That way
you could allow people (E)xecute access without
giving then (R)ead/Copy access.

Just a couple of passing thoughts - worth less
than a "penny for my thoughts."

David
--


"Ram" <Ram DeleteThis @discussions.microsoft.com> wrote in message
news:CD762B0A-296E-49A3-99A1-D88E0203BC4C@microsoft.com...
> Hi Kerry,
>
> 1) In the error message Test Project has a space in it. In the code it
> doesn't. Is this just a typo in your post? : Yes.There is no space between
> testproject in either of them.
>
> 2) Is the program running as the administrator account? Yes
>
> 3) Are the files deleted and not the folder or is nothing deleted?
>
> All the folders, and the files in those folders are being deleted. But not
> files with in Testproject.In the code we are assuming Testproject as 'My
> documents'.This is because we have some system files in 'My Documents'.
>
> Testproject (folder)
> -> folder f1 (deleted)
> -> folder f2 and files a1,a1 in f2 (deleted)
> -> file b1, b2 in Testproject (Not being deleted)
>
>
> Hi Wesley,
>
> All the settings in 'User Rights Assignment' of local security policy are
> default and the machine is in work group.
>
> Regards
> Ram
>
>
 >> Stay informed about: Removing read only attributes on folders 
Back to top
Login to vote
Display posts from previous:   
   Windows XP Arc2 (Home) -> Security Admin All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Categories:
 Windows XP
 Windows Vista!
 Win 2000/NT/98/ME


[ Contact us | Terms of Service/Privacy Policy ]