To download NI software, including the products shown below, visit ni.com/downloads.
Overview
The example demonstrates how to open the default program in Windows for a specified file.
Description
This application calls the user32.dll and shell32.dll in Microsoft Windows to open, edit, print, explore, and find files based on the default application for that file type.
For example, if you open a *.avi file Windows will open that file with the default application for that file type. On many computers that may be the Windows Media Player.
Requirements
Software
Hardware
Steps to Implement or Execute Code
Additional Information or References
This example works on windows operating systems only. The call library function node is calling Microsoft Windows specific libraries that do not exist on other operating systems.
Microsoft MSDN: ShellExecute function (Windows)
https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx
**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Nice code,
thanks for posting it.
Useful example. Tested in LabVIEW 2015 and Windows 7 x64 and still works fine. Please keep this post live.