Set IP Address Programmatically Using LabVIEW

Updated Oct 22, 2023

Reported In


  • LabVIEW

Issue Details

  • Is it possible to set the IP address, Subnet Mask, and Default Gateway of my computer programmatically in LabVIEW?


You can change network configurations using the System Exec VI, which invokes the command window. Right-click on the Block Diagram of a VI to show the Functions Palette and navigate to Connectivity>>Libraries & Executables and place the System on the block diagram. Right-click on the Command line input terminal of the System and select Create Constant. In the created string constant, type the following arguments:

netsh interface ip set address name="Local Area Connection" static 1

This will configure the connection named Local Area Connection to use static IP address, subnet mask and DNS server 1.

Additional Information

In some cases, running the vi will not work due to Windows security permission. In order to workaround this security issue, Right-click Labview.exe and select Run as Administrator. If errors persist contact your network administrators to confirm no other network misconfigurations may be causing unexpected behaviors.