Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.


Go Back   Vista Forums > Misc Newsgroups > .NET General

RB

Vista - System Permissions (followup)

Reply
 
09-03-2009   #1
ngrTerry


 
 

System Permissions (followup)

Following my previous post regarding System Permissions the scenario
has changed.

This program of ours will run on installation by the administrator.

It will create a folder in documents and settings\allusers\application
data
It will then create a file in that folder called config.txt (let us
say)

I need at this point to be able to set the system permissions for this
file so that all users who log on have security permissions to write
to this file at this point.

When other users log in I want them to have write permissions to this
file.

I have mamaged to create the file as read/write for the administrator,
but not change the permissions yet.

Can THIS be done please and HOW?

My System SpecsSystem Spec
09-03-2009   #2
Wyrm


 
 

Re: System Permissions (followup)

On 3 sep, 12:08, ngrTerry <n...@xxxxxx> wrote:
Quote:

> Following my previous post regarding System Permissions the scenario
> has changed.
>
> This program of ours will run on installation by the administrator.
>
> It will create a folder in documents and settings\allusers\application
> data
> It will then create a file in that folder called config.txt (let us
> say)
>
> I need at this point to be able to set the system permissions for this
> file so that all users who log on have security permissions to write
> to this file at this point.
>
> When other users log in I want them to have write permissions to this
> file.
>
> I have mamaged to create the file as read/write for the administrator,
> but not change the permissions yet.
>
> Can THIS be done please and HOW?
Are you just looking for a way to add Write to this file permissions?
Something like this, maybe:
System.Security.AccessControl.FileSecurity fs = new
System.Security.AccessControl.FileSecurity();
fs.AddAccessRule(new
System.Security.AccessControl.FileSystemAccessRule("All Users",
System.Security.AccessControl.FileSystemRights.Write,
System.Security.AccessControl.AccessControlType.Allow));
System.IO.File.SetAccessControl("c:\\documents and settings
\\allusers\\applicationdata\\config.txt", fs);
My System SpecsSystem Spec
Reply

RB


Thread Tools


Similar Threads for: System Permissions (followup)
Thread Forum
Overriding System Permissions .NET General
Programs - Replace System Program without Modifying System Files or Permissions Tutorials
Can I make a followup to Vista mail
Permissions for system files Vista file management
Microsoft documentation about file system permissions Vista security


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd