Thanx Irwin!
That's exactly what I was looking for, and in fact I had Win2000
installed on a computer I gave my father a few years back and remember
downloading the resource kit so I'll look for it there first!
What I think I may do since one can distribute and run this utility
as part of or at least alongside of my application, I'll call it from the
Administration page of my application and tie it into a File Search and
Tagging module that is also part of it. This way the administrator can
simply tag the directories and/or files he's worried about and then call the
utility from a button-click which will create a command-string appropriate
for making the tagged directories and files private. I certainly couldn't
trust these guys to create the proper commands them selves or they end up
making the entire hard drive inaccessible to everyone! <g>
from Robert Meek dba Tangentals Design CCopyright 2006
Proud to be a moderator of "The Delphi Lists" at elists.org
"When I examine myself and my methods of thought, I come to the conclusion
that the gift of Fantasy has meant more to me then my talent for absorbing
positive knowledge!"
Albert Einstein
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Irwin Scollar
Sent: Sunday, September 17, 2006 7:13 AM
To: Borland's Delphi Discussion List
Subject: Re: User rights under XP Pro
Try the command line utility cacls.exe (in %windir%\system32 to set
access rights on directories or files in XP easily.
Spawn it from an application which runs with administrative rights
and appropriate switches if required. If need be, run the
application from a non-administrator account with runas in the
Properties box and as /user:xxxxx, with xxxxx an administrator name.
Under Vista, always use runas.
If you don't want to have to give the password to a user, put the
/savecred switch in before the /user switch and run it once as an
administrator. It won't ask for a password again. If on a domain, see
the command line help for runas.
For greater control, download the Windows 2000 resource kit or
search for it on the MSDN DVD's and install to get xcacls.exe which
has a few additional rarely needed switches.
Cacls.exe is on all versions of 32 bit Windows, and xcacls.exe is a
ca. 80 kb file which can be distributed with an application or called
from an installation program when it closes.
If you are interested in all the gory details, enter "access control
list" on the MSDN web site where you'll find references to all the
API's which of course you can use in any program that is run with
administrative rights or with runas.
Irwin Scollar
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi