Home All Groups Group Topic Archive Search About

Changing folder security

Author
30 Mar 2005 2:12 PM
Feldman Alex
Hi all!
I need to set folder security to full control to everyone
is it possible from code (without calling any external applications and
sripts) ?
example would be nice.

Thanx

Author
30 Mar 2005 3:17 PM
Nicole Calinoiu
This functionality is not available in the v. 1.x .NET Framework.  You could
either call the relevant Windows API functions yourself via p/invoke or use
a wrapper API like the one available at
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9.

HTH,
Nicole



Show quoteHide quote
"Feldman Alex" <utxe***@mail.ru> wrote in message
news:eRku4JTNFHA.2136@TK2MSFTNGP14.phx.gbl...
> Hi all!
> I need to set folder security to full control to everyone
> is it possible from code (without calling any external applications and
> sripts) ?
> example would be nice.
>
> Thanx
>
>
Author
30 Mar 2005 4:19 PM
Feldman Alex
Thanks Nicole

Maybe you know which Windows API should i use

Thanks again
"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:OJaxzwTNFHA.1172@TK2MSFTNGP12.phx.gbl...
> This functionality is not available in the v. 1.x .NET Framework.  You
could
> either call the relevant Windows API functions yourself via p/invoke or
use
> a wrapper API like the one available at
>
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9.
Show quoteHide quote
>
> HTH,
> Nicole
>
>
>
> "Feldman Alex" <utxe***@mail.ru> wrote in message
> news:eRku4JTNFHA.2136@TK2MSFTNGP14.phx.gbl...
> > Hi all!
> > I need to set folder security to full control to everyone
> > is it possible from code (without calling any external applications and
> > sripts) ?
> > example would be nice.
> >
> > Thanx
> >
> >
>
>
Author
30 Mar 2005 4:53 PM
Nicole Calinoiu
There are many Windows API functions that you will need to call in order to
set the ACL on a file.  Even if you don't want to use the library available
at
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9,
you could download it and examine its API usage in order to figure out how
this is done.



Show quoteHide quote
"Feldman Alex" <utxe***@mail.ru> wrote in message
news:%23yGkJRUNFHA.1308@TK2MSFTNGP15.phx.gbl...
> Thanks Nicole
>
> Maybe you know which Windows API should i use
>
> Thanks again
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
> news:OJaxzwTNFHA.1172@TK2MSFTNGP12.phx.gbl...
>> This functionality is not available in the v. 1.x .NET Framework.  You
> could
>> either call the relevant Windows API functions yourself via p/invoke or
> use
>> a wrapper API like the one available at
>>
> http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9.
>>
>> HTH,
>> Nicole
>>
>>
>>
>> "Feldman Alex" <utxe***@mail.ru> wrote in message
>> news:eRku4JTNFHA.2136@TK2MSFTNGP14.phx.gbl...
>> > Hi all!
>> > I need to set folder security to full control to everyone
>> > is it possible from code (without calling any external applications and
>> > sripts) ?
>> > example would be nice.
>> >
>> > Thanx
>> >
>> >
>>
>>
>
>
Author
31 Mar 2005 9:21 AM
Feldman Alex
Thanx a lot Nicole

"Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
news:uMtp4jUNFHA.1176@TK2MSFTNGP10.phx.gbl...
> There are many Windows API functions that you will need to call in order
to
> set the ACL on a file.  Even if you don't want to use the library
available
> at
>
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9,
Show quoteHide quote
> you could download it and examine its API usage in order to figure out how
> this is done.
>
>
>
> "Feldman Alex" <utxe***@mail.ru> wrote in message
> news:%23yGkJRUNFHA.1308@TK2MSFTNGP15.phx.gbl...
> > Thanks Nicole
> >
> > Maybe you know which Windows API should i use
> >
> > Thanks again
> > "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in
message
> > news:OJaxzwTNFHA.1172@TK2MSFTNGP12.phx.gbl...
> >> This functionality is not available in the v. 1.x .NET Framework.  You
> > could
> >> either call the relevant Windows API functions yourself via p/invoke or
> > use
> >> a wrapper API like the one available at
> >>
> >
http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9.
Show quoteHide quote
> >>
> >> HTH,
> >> Nicole
> >>
> >>
> >>
> >> "Feldman Alex" <utxe***@mail.ru> wrote in message
> >> news:eRku4JTNFHA.2136@TK2MSFTNGP14.phx.gbl...
> >> > Hi all!
> >> > I need to set folder security to full control to everyone
> >> > is it possible from code (without calling any external applications
and
> >> > sripts) ?
> >> > example would be nice.
> >> >
> >> > Thanx
> >> >
> >> >
> >>
> >>
> >
> >
>
>
Author
31 Mar 2005 4:33 PM
Joseph MCAD
March 31, 2005

     It is not provided in .Net 1.* directly, but it is very easy to do with
a different class. You just have to use the command line from code. (By the
way, it is supported in 2.0)

  Imports System.Diagnostics

  dim Pro as new Process
  Pro.StartInfo.Filename = "xcacls"
  Pro.StartInfo.Arguments = "FOLDERPATH /G Everyone:F /Y
  'Set so that no window appears while running
  Pro.StartInfo.UseExecuteShell = false 
  Pro.StartInfo.CreateNoWindow = true
  'Redirect output to the process class for futher examination
  Pro.StartInfo.RedirectStandardOutput = true

  Pro.Start
  dim reader as streamreader = Pro.StandartOutput 
  dim output as string = reader.readtoend

  Pro.WaitForExit()
  reader.close
  messagebox.show(output)

  This will show the output generated from xcacls in a messagebox. I hope
this helps and have a great day! (This is how you can use command line
programs from code.)


     Joseph MCAD


Show quoteHide quote
"Feldman Alex" wrote:

> Thanx a lot Nicole
>
> "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in message
> news:uMtp4jUNFHA.1176@TK2MSFTNGP10.phx.gbl...
> > There are many Windows API functions that you will need to call in order
> to
> > set the ACL on a file.  Even if you don't want to use the library
> available
> > at
> >
> http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9,
> > you could download it and examine its API usage in order to figure out how
> > this is done.
> >
> >
> >
> > "Feldman Alex" <utxe***@mail.ru> wrote in message
> > news:%23yGkJRUNFHA.1308@TK2MSFTNGP15.phx.gbl...
> > > Thanks Nicole
> > >
> > > Maybe you know which Windows API should i use
> > >
> > > Thanks again
> > > "Nicole Calinoiu" <calinoiu REMOVETHIS AT gmail DOT com> wrote in
> message
> > > news:OJaxzwTNFHA.1172@TK2MSFTNGP12.phx.gbl...
> > >> This functionality is not available in the v. 1.x .NET Framework.  You
> > > could
> > >> either call the relevant Windows API functions yourself via p/invoke or
> > > use
> > >> a wrapper API like the one available at
> > >>
> > >
> http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=e6098575-dda0-48b8-9abf-e0705af065d9.
> > >>
> > >> HTH,
> > >> Nicole
> > >>
> > >>
> > >>
> > >> "Feldman Alex" <utxe***@mail.ru> wrote in message
> > >> news:eRku4JTNFHA.2136@TK2MSFTNGP14.phx.gbl...
> > >> > Hi all!
> > >> > I need to set folder security to full control to everyone
> > >> > is it possible from code (without calling any external applications
> and
> > >> > sripts) ?
> > >> > example would be nice.
> > >> >
> > >> > Thanx
> > >> >
> > >> >
> > >>
> > >>
> > >
> > >
> >
> >
>
>
>