From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

How to have LabVIEW mount a remote SMB Share

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
Programmatically mount a remote SMB (Windows) share as a disk drive through LabVIEW.

Description:
This example uses the "System Exec.vi" to execute a system-level command line. In this case, it executes the command to mount a remote SMB (Windows) share as a disk drive, assuming the following parameters:
Windows Domain: DOMAIN
Windows Username: USER
Windows Password: PASSWORD
File Server IP: 127.0.0.1
File Server Share: STORAGE
Desired Mount Point: Z:

Instructions:
To implement this example:

  1. Open the attached "Windows Mount Drive.vi"
  2. In the block diagram, change the listed parameters as they apply to your machine
  3. Run the VI

To execute this example:

  1. Install the required software.
  2. Open the VI and refer the Implement Steps


Requirements
Software
LabVIEW 2012 or compatible

Hardware
-

bd.PNGfp.PNG

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

Joe Daily
National Instruments
Applications Engineer

may the G be with you ....

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