Creating a file programmatically gives wrong file ownership

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I create a file from a simple command line application written in C# the
file ownership given to the newly created file is of administrators group
although I am running this application in my identity. I would expect that a
created file will get the ownership of the running process identity.

code:

in the Mail I have a single line: File.Create(@"c:\test.txt");
 
Hi,
the file ownership given to the newly created file is of
administrators group although I am running this application
in my identity. I would expect that a created file will get the
ownership of the running process identity.

I'd suspect a Windows security setting, which determines whether files
created by anyone in the local Administrators group are given the ownership
of the user account, or of the Administrators group. This may be set
through local security policy or through GPO in a domain environment (for
which it is mainly intended).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top