LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Ajay_MV

Open file folder location in Windows Explorer

Status: New

There has been always the need of opening the file/folder location in windows explorer, but I guess every application uses the trick of doing it through "System Exec.vi" or "Open URL" or Win32 API.  There is no LabVIEW native function to directly open folder/files in windows explorer directly.

 

Below threads discusses various methods to achieve this...

http://forums.ni.com/t5/LabVIEW/Use-LabVIEW-to-open-Windows-Explorer-to-a-certain-directory/td-p/898...

https://lavag.org/topic/11395-opening-windows-explorer-to-a-specific-directory/

https://lavag.org/topic/18444-open-windows-folder/

https://decibel.ni.com/content/docs/DOC-14633

https://decibel.ni.com/content/docs/DOC-22461

 

It would be nice if LabVIEW comes with some native function like below

 

File Folder Idea Exchange.png

--
Ajay MV


19 Comments
Ajay_MV
Active Participant

Hmm... That's what happening in my machine and all my colleagues machine (about 3 machines here) which have Win 7 with LV2014...

 

One other thing is that, in "System Exec.vi", we tend to give the input terminal 'run minimized' =TRUE in order to avoid seeing the black command prompt screen (which becomes visible occasionally based on system performance).  However, it will eventually minimize the opened file or folder which is not desired.

--
Ajay MV


X.
Trusted Enthusiast
Trusted Enthusiast

I verified that it works as I said on MacOS (LabVIEW 2011 32 bit). That is, passing a folder opens the Finder (equivalent to Windows Explorer on Windows) and passing a .txt file opens TextEdit (equivalent to Notepad on Windows), without intervention of any browser.

 

I am positive that it used to work as I described originally on the Windows VM I first tried it on, on the Window side (of another Mac). I am at a loss as to why it stopped working that way after I checked again yesterday.

X.
Trusted Enthusiast
Trusted Enthusiast

I managed again to have Windows Explorer open a folder when using the VI we have been discussing all along (on the same machine I have been using for these tests).

However, passing a path to a.txt file launched IE.

Puzzled.

X.
Trusted Enthusiast
Trusted Enthusiast

Screen capture of my latest try in Windows 7 on a Mac.

A folder is properly opened by Windows Explorer.

In the second attempt (opening a txt file), IE opened on another monitor, so I had to fetch the window to bring into the captured frame.

altenbach
Knight of NI
Could it be that windows explorer (instead of a browser) is incorrectly defined as the default browser?
X.
Trusted Enthusiast
Trusted Enthusiast

No it's not. IE is. If I set Chrome as the default browser, the txt file is opened in Chrome.

RavensFan
Knight of NI

I tried that program on my Win7 64 bit PC.  Both files and folders opened within Firefox, my default browser.

AristosQueue (NI)
NI Employee (retired)

Here you go:

https://decibel.ni.com/content/docs/DOC-46861

VI is saved in LV 2015.

elset191
Active Participant

To add more data several years after the fact...

I have code I wrote I first wrote in LV2010, then LV2012 that always opened a directory in Windows Explorer.  I recently started working in LV2014, and the same code opens my directory in Firefox (my default web browser).

This appears to be the case in both Windows 7 and Windows 10.  32 bit LabVIEW on 64 bit OS in all instances.

 

AQ, I can't access that page you linked.

 

 

--
Tim Elsey
Certified LabVIEW Architect