How Can I Set The IP Address Programmatically in LabVIEW

Updated May 15, 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 need to use 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 Exec VI on the block diagram. Right-click on the Command line input terminal of the System Exec VI 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.