I have a file (my file, not a third-party program) located in the C: \ ProgramData directory .... The problem is that I cannot read it. The process that tries to read the file is a service running as NT AUTHORITY \ SYSTEM in the application manifest of the "highestAvailable" right. I read the simple File.ReadAllLines () method.

  • Well, are you sure that this user has rights to read that file? - tym32167
  • @ tym32167 it seems to me that if I am on behalf of the system (csrss, lsass, i.e. extremely important system processes are run with the same rights, then I have the same rights as they are - Oleg Lylok
  • @ tym32167 and they can read whatever they want - Oleg Lylok
  • Look, you say that you run the software on behalf of the system and it cannot read the file. There are two options - either the system does not have access to read the file, and you need to increase and prescribe the rights explicitly, or you are mistaken that you started the software from the desired user - and then you need to investigate what you are doing wrong when you start. - tym32167
  • @ tym32167 is still an add-on: earlier (a month ago) everything worked, maybe the Windows update played a role or something like that. Also, I updated Kaspersky Internet Security from version 18 to version 19. I think the antivirus can block, because there is a whole gig of update files, patches in ProgramData \ Kaspersky Lab. - Oleg Lylok

1 answer 1

The problem was that in some way there was no access to the folder. Having recreated the folder, the problem was solved.