02-23-2009 04:01 PM
I have a LV program that is generating a list of files that I may want to open using the associated Windows program. Some are standard Office files but others require proprietary analysis programs. All have Windows associations such that I can double click on the file name in the Windows file manager and launch the appropriate program. I would like to mimic this behavior within my LV program but without coding a case for each file extension, some of which I may not anticipate now.
02-23-2009 04:22 PM
02-24-2009 01:49 AM
Have a look at vi.lib\platform\browser.llb\open a document on disk.vi.
It tries to use DDE, and if that fails, tries to build a command line as Ravens Fan suggested.
02-24-2009 07:25 AM
02-24-2009 07:55 AM
tst wrote:Have a look at vi.lib\platform\browser.llb\open a document on disk.vi.
It tries to use DDE, and if that fails, tries to build a command line as Ravens Fan suggested.
Thank you Yair!
I did NOT know that.
Ben
02-24-2009 11:00 AM
02-24-2009 01:09 PM
05-13-2009 03:11 PM - edited 05-13-2009 03:17 PM
There are some problems with that VI. I have one user that I had to track a problem down with trying to open a PDF file. Their registry key HKEY_CLASSES_ROOT\.pdf was read in with a value of "AcroExch.Document " (with a lot of spaces after it), which prevented this VI from finding the next key (AcroExch.Document\shell\open\command) which identifies the path to Adobe Acrobat. Instead of getting the path to Adobe Acrobat, I got back "Adobe Acrobat 7.0 Document" as the path (see attached error).
I checked the key with the Windows registry editor, and it did NOT show the extra spaces. However, just opening the key and selecting OK (without making changes) was enough to clear the problem.
Not sure if this problem is with the registry keys that Adobe Acrobat created when it was installed or upgraded (the user was on version 9.0, but there are older versions on that machine, too), or if the problem was with the LabVIEW registry key readers in Open a Document on Disk.vi.
05-14-2009 09:22 AM - edited 05-14-2009 09:24 AM
The VI mentioned by Yair works on the Macintosh by calling an Applescript which tells the Finder to open the file. The code segment shown in the image also works via the System Exec.vi. The quotes " " are to allow the Unix shell called by the VI to handle filenames with spaces.
Lynn