LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically opening files with a Labview program from windows explorer (Using "Open with...")

Hi,

I would like to be able to "link" certain file types (certain extensions) to a Labview program I wrote. We have a measurement program (under Labview) that generates files with a certain extension. I would like to link those files with my analysis program. Such that I can just click on them in the windows explorer, and that then the Labview program is started with that file.

I'm using Labview 6i under windows 98.

Is this possible? Does anyone have any ideas?

Any help would be greatly appreciated.

Thanks in advance,

Erik van Dijk
0 Kudos
Message 1 of 7
(3,969 Views)
Is your LabVIEW program a built executable? If so take a look at this link to see how to get the calling file path. Then all you have to do is associate your program with the extension you want (Do this in folder options under view in explorer). If its not an executable, then I don't think so.
0 Kudos
Message 2 of 7
(3,969 Views)
Most of the applications take the file name to open as a command line argument (for example 'notepad something.txt'). If you go in File explorer View/Options/File Types and look for TEXT document - Edit / select from Actions OPEN / Edit / you'll have the application to open it (Notepad).
For your file type:
- create a new file type
- define the parameters for OPEN action
- code in your application to look for any command argument at the start before any other operation (i'm not sure if it's possible with a lv exe ... in visual basic, for example, you have a variable COMMAND that stores the command line argument - you can read this and if it's a valid file name you can use it as you want)

Let me know if something unclear
0 Kudos
Message 3 of 7
(3,969 Views)
The problem with the command line method suggested is that once your
application is running, it won't react anymore to user double-clicks in the
file explorer.

I have written an article about this topic, with some sample code. See my
LabVIEW pages at
http://cybertechs.qc.ca/~jpdrolet/labview

Basically, you register the file extension to a second application that
reads the command line, runs your application (or LabVIEW) if not already
running, sends to it the file name and exits.

Repost if you have any other question.

Jean-Pierre Drolet



"premium" a ecrit dans le message news:
5065000000080000006F2E0000-1002247793000@exchange.ni.com...
> Hi,
>
> I would like to be able to "link" certain file types (certain
> extensions) to a Labview
program I wrote. We have a measurement
> program (under Labview) that generates files with a certain extension.
> I would like to link those files with my analysis program. Such that I
> can just click on them in the windows explorer, and that then the
> Labview program is started with that file.
>
> I'm using Labview 6i under windows 98.
>
> Is this possible? Does anyone have any ideas?
>
> Any help would be greatly appreciated.
>
> Thanks in advance,
>
> Erik van Dijk


LabVIEW, C'est LabVIEW

Message 4 of 7
(3,969 Views)
Jean-Pierre,
Good idea! I have never actually used that method in an application, just toyed around with it. I never even considered what would happen if you tried to open another program while it was already running.

Thank you
Brian Vibert
0 Kudos
Message 5 of 7
(3,969 Views)
Hello
I would be very interested in reading you article about this subject (http://cybertechs.qc.ca/~jpdrolet/ labview), but the url is not any more available. could you please post it on NI webpage, or send the new url.
Thanks a lot

Nicolas Minary
0 Kudos
Message 6 of 7
(3,969 Views)
-
It is now available at http://openg.org >> Site Docs >> Guidelines to file association and LabVIEW


LabVIEW, C'est LabVIEW

0 Kudos
Message 7 of 7
(3,969 Views)