08-05-2021 06:38 AM
Hello,
Shall we edit the file permission (deny - delete) access to the user account programmatically?
08-05-2021 10:27 AM
You probably need to provide some context. What are you trying to achieve?
08-06-2021 11:47 AM
@விக்னேஷ்_ராஜேந்திரன் wrote:
Hello,
Shall we edit the file permission (deny - delete) access to the user account programmatically?
I am not sure if you can even do this in Windows... I mean you can set file permissions at a group level and using Windows "policies" only allows certain groups to change or delete a file. But if a user creates a file then that user "owns" that file, and I don't think you can prevent the file owner from deleting or modifying a file they own.
But that being said... I can't think of a way to do this programmatically in LabVIEW unless you use one of the Windows API calls that can invoke the Windows Group Policy Editor or maybe edit a Registry key.
08-06-2021 11:54 AM
@விக்னேஷ்_ராஜேந்திரன் wrote:
Shall we edit the file permission (deny - delete) access to the user account programmatically?
This is a question about an intent (shall we?), i.e. Is it a good idea? (Not "how do we do that?").
A "user account" is not a "file", so file permissions are irrelevant. Are we talking about file ownership or access rights?
As I said, we need significant clarifications until we can even attempt to answer.
08-07-2021 05:56 AM
@RTSLVU wrote:
But that being said... I can't think of a way to do this programmatically in LabVIEW unless you use one of the Windows API calls that can invoke the Windows Group Policy Editor or maybe edit a Registry key.
Another option often overlooked is the command line. It’s not the first choice in Windows usually, because the command line isn’t really a neatly integrated OS feature nor is it particularly fast since it involves creating at least one (sometimes more) process which is relatively slow under Windows. Still it often beats trying to find API documentations and fiddling with its intricacies.