LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can you edit file properties using Labview?

These Attributes can be set and retrieved with the kernel32.dll.GetFileAttributes() and kernel32.dll.SetFileAttributes() APIs very easily. That is not the problem, and password protecting such a VI is quite overkill!

The earlier poster wanted to change other things of a file such as comment, description etc. and that are not properties handled through the Windows API but by the shell (File Explorer) and stored in NTFS streams in a property handler private format.

The property handlers for any specific file type are implemented as COM objects and invoking them is only possible from C/C++ code. So someone would need to write a DLL that does the enumeration of the property handlers for a particular file type, then invoking them all to enumerate the properties each of them supports for that file and invoking them again to retrieve and/or change the property value for each of them. This DLL then can be called from LabVIEW to do the nitty gritty stuff of communicating to the shell property handlers and return the interesting stuff to the caller.

 

More easy would be probably to use something like https://filemeta.codeplex.com/ and using their command line tool through System Exec, retrieve the desired informations from a file and make modifications to the metadata of said file. Note however that this metadata is not stored directly in the file and associated with the file through the File Explorer shell. As long as you move or copy a file through File Explorer the association is maintained but if you do this through another application such as a LabVIEW File Move, there is a good chance that the association is lost and therefore the file looses all the properties. They get definitely lost if you email a file or transfer it to a non NTFS media such as FAT32 formated USB disk.

Rolf Kalbermatter
My Blog
Message 11 of 12
(638 Views)

I extremely apologize for the password protection!!

I did that, because i did not complete the code. I wish to complete it fully with all the requirements and post it here.

But I am unable to find a solution yet. As of now I have developed the code to display the additional properties of the file. 

I have spent a lot of time to find a solution, but through the process I learnt many things about accessing DLLs.

But in my code I did not use any library calls. I have used cmd to get my code work Smiley Wink.

And i wish to thank you Smiley Happy.

0 Kudos
Message 12 of 12
(598 Views)