| View previous topic :: View next topic |
| Author |
Message |
arcray Valued Contributor


Joined: 13 Jul 2001 Posts: 242 Location: Aude, France
|
Posted: Wed Apr 16, 2003 8:16 am Post subject: Is it possible to change permissions on a folder? |
|
|
I distribute a VDS 4.5 database application that requires administrative priviledges to be installed (using Inno Setup 3.0.6) on the server. After installation the data files are stored in a folder of the user's choice. All subsequent installations on workstations should also point to this folder on the server.
This data folder needs to have the permissions set to allow full access to all users. This is fairly trivial to do if you know how, but I am discovering that a lot of users out there do not!
Is there a way for VDS, or a DLL, to set permissions for a folder in an NT, or XP enviroment.
Thanks in advance _________________ Andrew GRAY
If you don't know I am looking for work, I won't get the job.
andrewrcgray.com |
|
| Back to top |
|
 |
bbelcher Contributor

Joined: 30 Jul 2002 Posts: 172
|
Posted: Wed Apr 16, 2003 2:00 pm Post subject: |
|
|
I've used a program thats either from the nt resource kit or that's included with NT/2000. It's called cacls.exe. The below code is a non working sample. Just change the varibles to what you need and it should add the current user to change permissions "%%username:C "and local administrators to full permissions "Administrators:F"
link to cacls useage: http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/winxppro/proddocs/cacls.asp
| Code: |
%%progpath = @shortname(@CURDIR()\cacls.exe
%%username = @REGREAD(LOCAL,SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon,DefaultUserName)
%%dirpath = directory you want to change permissions on
runh cmd /c echo y| @shortname(%%progpath) %%dirpath\%%username /G %%username:C Administrators:F,WAIT
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|