Windows 7 Security Policy: How do I allow my .NET application to write to the "C:" drive?

My application does not have to perform any administrative tasks, so I want a regular user account to be able to run it. The only thing my application reads and writes to the database file; if a user running Windows 7 (or Vista) installs my application on drive C, setting the default permission set for the drive does not allow my application to write data.

How can I allow my application to write in C :, without requiring full administrative rights?

+3
source share
5 answers

, .exe, , . .exe , .

, .exe .

.exe Process ACL, Windows (icacls.exe), :

ICACLS.EXE [TargetDir] /T /C /grant Users:F

(, [TargetDir] "\", .)

. .NET- , !

, , , ; .

, , .

0

( ). , , , c, .

+1

db ​​/ / app/. . C:/Program Files - . , .

+1

UAC ( ) . C: Windows XP.

+1

C:, , , , (C:/Program Files/Your App/) C:

String Path = Path.GetDirectoryName(Application.ExecutablePath);
-1

Source: https://habr.com/ru/post/1734860/


All Articles