From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File Permissions

Hello,

 

Shall we edit the file permission (deny - delete) access to the user account programmatically?

0 Kudos
Message 1 of 5
(1,010 Views)

You probably need to provide some context. What are you trying to achieve?

0 Kudos
Message 2 of 5
(977 Views)

@விக்னேஷ்_ராஜேந்திரன் 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.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 5
(936 Views)

@விக்னேஷ்_ராஜேந்திரன் 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.

0 Kudos
Message 4 of 5
(932 Views)

@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.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 5
(898 Views)