LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use Windows .dll to protect a folder

Hello guys!
 
I need to protect the access a special folder that my software uses. My idea it's to programmatly choose a certain folder and introduce on it a password. My main question is if there exists in WinXp a .dll that I can use for this?
 
Best regards and a happy new year!
Software developer
www.mcm-electronics.com





PORTUGAL
0 Kudos
Message 1 of 5
(3,565 Views)
The only thing that you can really do with Windows functions is to set up the security such that a specific user or group has access to it, since that's how the security protocols in Windows basically work. You can't password protect a folder the way I think you're thinking about doing. For what you're thinking you would need third-party software. Now if you're trying to set up security via a LabVIEW custom-written security protocol, that's a different story. For that you don't need Windows API functions. You just have your program check if a certain folder is being accessed and if so you pop up a dialog box asking for a password. Where you store this password is up to you.

Am I understading your question correctly?
Message 2 of 5
(3,554 Views)

Well, I think that’s not quite it!

 

In sum, I want to restrict the access to a certain folder (only accessible to a private group), using the actual tools (libraries like .dll) that we normally have in windows and Labview. This to avoid introducing the necessity of installing the third-party software that you mentioned before. Do you know a way of doing this?

 

Best regards

 

Jorge Amaral

Software developer
www.mcm-electronics.com





PORTUGAL
0 Kudos
Message 3 of 5
(3,541 Views)
Well, I'm still not sure why you can't just set the permissions on the folder from Windows directly. You know, right click on the folder, select "Sharing and Security" and switch to the "Security" tab. Set the ACL (Access Control List) as required and you're done.

Unless this folder is created on the fly by your LabVIEW code? If that's the case then you have a couple of options. The first is to use the Windows API to set the ACL as needed. This requires calling Windows DLLs. Not really all that fun and prone to error. However, before you go down that route you should try an alternative which may be easier. You can use the command-line cacls command. You can get more detailed info here :

    http://www.windowsnetworking.com/kbase/WindowsTips/WindowsNT/AdminTips/Miscellaneous/UseCACLSWindowsNTutilitytoeditordisplayfilepermissions.html

If that isn't enough you can try the open-source utility "SetACL" found at:
    http://www.helge.mynetcologne.de/setacl/

You can just run either of these with the LabVIEW "System Exec" function.

[Edit] Actually, the new version of SetACL is supposed to be available as an ActiveX-DLL so you should be able to use it directly from within LabVIEW. If you need more help let me know.

Why don't you give those a try to see if they fit the bill before delving into the Windows API calls.

-Saverio

Message Edited by smercurio_fc on 12-29-2005 11:44 AM

Message 4 of 5
(3,529 Views)
Ok! Thanks!
 
I think this might be the answer for me!
 
Best regards,
 
Jorge
Software developer
www.mcm-electronics.com





PORTUGAL
0 Kudos
Message 5 of 5
(3,505 Views)