It is important to consider that Windows sets permissions to read and write files based on the user (or the group of which he is a member) and ACL entries in the file system. Thus, "preventing other applications from writing to this folder" really "other applications that run as a regular user."
You can place the service in a directory under
C:\Program Files,
eg.
C:\Program Files\CompanyName\ServiceInstallDir
If the service runs under the local SYSTEM account, it has permission to write to this folder. And ordinary users have read-only access.
But keep in mind that this is not bulletproof, and you never know if someone with administrator rights will change the permissions on your folder after installation.
, (, Active Directory ).
, " " Windows, SYSTEM , .
( Active Directory) , .
, " " ( AD).
: - () Restore Privileges, ACL.
:
SYSTEM , , .
eryksun (. ) !
. https://blogs.technet.microsoft.com/voy/2007/03/22/per-service-sid/
, .