in VB.NET, I am trying to assign Group rights to a network file. I am
successfull at impersonating a domain account with rights but the following
code is failing, ie, nothing happens at the file level.
MyProcessString = "cacls.exe """ + ICopyTo + """ /E /G """ + ICopyRights +
""":R"
System.Diagnostics.Process.Start(MyProcessString)
msgbox(MyProcessString)
the MyProcessString MsgBox shows: cacls.exe
"\\main\documents\filename.txt" /E /G "DOMAIN\group name":R
cacls does work with group names and I can get this code to run as a batch
file under the impersonation runas account just fine
I have also tried:
p.StartInfo.FileName = "cacls.exe"
p.StartInfo.Arguments = MyProcess '"" + ICopyTo + """ /E /G """ +
ICopyRights + """:R"
p.StartInfo.Arguments = ICopyTo + " /E /G " + ICopyRights + ":R"
p.StartInfo.RedirectStandardOutput = True
p.StartInfo.UseShellExecute = False
p.StartInfo.WindowStyle = ProcessWindowStyle.Minimized
p.StartInfo.CreateNoWindow = True
p.Start()
p.WaitForExit()
ProcessOutput = p.ExitCode.ToString()
but I get a variety of error numbers like error 5, etc.. and I do not know
where I can find error code interpretations and this does not work either
....
Any suggestions !
Thanks
Terry