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
[quoted text, click to view] "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" <utxed94@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" <utxed94@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
> > >> >
> > >> >
> > >>
> > >>
> > >
> > >
> >
> >
>
>