LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to hide the .txt file through program

In my logic, I write the .txt file, after writting, I have to change the .txt file property "Attributes" as "Read Only" and "Hidden"

 

Plz give the solution and example.

 

 

Manohar Patil

0 Kudos
Message 1 of 8
(3,388 Views)

It would help if you shared what OS you are working with.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 8
(3,372 Views)

There is no LabVIEW function to do that. You will need to use an operating system function to do it. The method varies, depending on the operating system. On Windows you can use Windows API calls or you can just use the command line commands, such as attrib via System Exec.

Message 3 of 8
(3,366 Views)

Thanx for replay

can you explain me through a example for OS Window XP.

0 Kudos
Message 4 of 8
(3,348 Views)

Working on Window XP

0 Kudos
Message 5 of 8
(3,347 Views)

Hello Dynamic

 

Thank you for posting your query. 

 

As per my reasearch on the subject and as mentioned by Jeff and Smercurio, you need to make windows API calls to set the file access permissions programmatically. 

 

A natural start would be use the "Call Llibrary Function Node" to make dll calls. The dll file that I believe would be relevant here is "advapi32.dll" located in system32 folder. 

 

This dll would contain functions like "BuildExplicitAccessWithName()" which give explicit access for reading or writing for any windows object. 

 

Though I could not find any relevant labview example code, the following links would be helpful to you.

 

http://support.microsoft.com/kb/295004/

 

http://support.microsoft.com/default.aspx?scid=kb;[LN];316440

 

Regards, 

 

Ashutosh Singh 

 

 

 

 

0 Kudos
Message 6 of 8
(3,313 Views)

A simple use of the attrib command would be like this:

 

Message 7 of 8
(3,283 Views)

Thank You Smercurio_fc

 

It working.............

 

thanx.

0 Kudos
Message 8 of 8
(3,258 Views)