Example Code

Copy Full File Paths from Mapped Network Drives

Code and Documents

Attachment

Overview

If you're using mapped network drives, Windows Explorer will copy a file location like this:

P:\Information\Schedule.docx

However, as people can assign any letter for their mapped network drive, this isn't very helpful for sharing file locations as you need to guess the start of the file path. This project contains an example of how you can build a piece of code to take an input from Windows Explorer and use the input to find the full path.

Code.PNG

This application can be built into an executable and used to add a new right-click context menu to Windows Explorer which would allow you to copy a file path similar to this:

\\Server\Public\Information\Schedule.docx

Context Menu.PNG

NB - the file path format will be in DOS format.

Steps to Install


  1. Open project and build into an executable - save exe and associated files in a new folder in the Program Files directory.
  2. Add the application to the Windows Explorer Context Menu by editing the Windows Registry. Instructions on how to do this can be found easily via Google.
  3. Right click on a file within a mapped network drive and copy the full file path to the clipboard.

Please note, editing the Windows Registry can cause issues so installing this program is undertaken at your own risk.

Requirements

LabVIEW 2015

Application Builder


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

Contributors