Set Folder Access Secuity permission for IUSR_<COMPUTERNAME>

Hi guys,

I've made simple ASP Script on IIS, and now I'm going to make the packaging.  I've trouble on how to set spesific folder security permission for IUSR_<COMPUTERNAME>, I need those to make sure that ASP/PHP?etc can accessed an mdb file.
Anyone can show me how to do thoses things programatically (using delphi code off course)?

Thanks
matelindonesiaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

illusion_chaserCommented:
Components package:
http://www.sharewareplaza.com/NTSet-download_20517.html (30 days trial or $99)
AFZDeveloperCommented:
uses AccCtrl, AclAPI;
...
...
procedure TForm1.Button1Click(Sender: TObject);
const
  FULL_CONTROL      = $001F01FF;
  READ_EXEC_CONTROL = $001200A9;
  LIMIT_CONTROL     = $001000A9;
  MODIFY_CONTROL    = $001301BF;
var
  path: string;
  pNewDACL : PACL;
  EA : array [0..5] of EXPLICIT_ACCESS;
begin
  path:='c:\test';
  ZeroMemory(@EA,6*Sizeof(EXPLICIT_ACCESS));
  BuildExplicitAccessWithName(@EA[0], PAnsiChar('testuser'), FULL_CONTROL, SET_ACCESS, SUB_CONTAINERS_AND_OBJECTS_INHERIT);
  BuildExplicitAccessWithName(@EA[2], PAnsiChar('IUSR_<COMPUTERNAME>'), MODIFY_CONTROL , SET_ACCESS, SUB_CONTAINERS_AND_OBJECTS_INHERIT); // access for other user
  BuildExplicitAccessWithName(@EA[4], PAnsiChar('SYSTEM'), MODIFY_CONTROL, SET_ACCESS, SUB_CONTAINERS_AND_OBJECTS_INHERIT);
  SetEntriesInAcl(1, @EA[0], nil, pNewDACL);
  SetEntriesInAcl(1, @EA[2], pNewDACL, pNewDACL);
  SetEntriesInAcl(1, @EA[4], pNewDACL, pNewDACL);
  SetNamedSecurityInfo(PChar(path), SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NIL, NIL, pNewDACL, NIL);
end;
//---------------------------------------------------

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
matelindonesiaAuthor Commented:
Hello AFZDeveloper,
Nice to meet you again, This time you're my Hero !
Bravo!!!
your code is running well and goes excelent, I've never thought I can do that without external library or component. Thanks again.

Best Regards
sirro
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.