Example Code

Programmatically Display Folder in Windows Explorer using System Exec in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This vi will display a folder path in windows explorer by using system executive.

 

Description

This vi will programmatically use System Executive to display a folder in Windows Explorer. It uses the file path selected by user and converts to a string which is passed to system exec.vi with the command "explorer <folder path>"


Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Download vi
  2. Run vi
  3. Select Folder/File
  4. Watch Windows Explorer open with the correct folder!

 

Additional Information or References
VI Snippet

288.png

**This document has been updated to meet the current required format for the NI Code Exchange.**

Ashish Naik
Automotive Business Development Manager
National Instruments UK

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
hex
Member
Member
on

That won't work, you should replace the "empty string" with "space constant". Cheers.

Ashish_Naik_NIUK
Active Participant
Active Participant
on

Thanks Hex. Slight mis-hap when cleaning up this vi for the community! - Have updated

Ashish Naik
Automotive Business Development Manager
National Instruments UK
hex
Member
Member
on

Hehe, no problem. I just got real lucky

Jayavel
Member
Member
on
  1. Ya its working good.Thanks for this code
herbert.niesler@emsolutions.com.au
Member
Member
on

Works in Vista.  Thanks very much for your vi.

Herbert Niesler
Mads
Active Participant
Active Participant
on

Another nice option here is the ability to select a file in the opened folder. This can be achieved by adjusting the command with the select switch:

explorer /select,c:\test\hello.dat' will  for example open an explorer window showing c:\test, with the hello.dat file selected.

Ajayvignesh_MV
Member
Member
on

Is there any way to select multiple files?