To download NI software, including the products shown below, visit ni.com/downloads.
Overview
Retrieve computer name programmatically.
Description:
This code shows how we can get the Computer Name of a PC by using the dll Kernel32.dll.
Instructions:
To implement this example:
To execute this example:
Requirements
Software
LabVIEW 2012 or compatible
Hardware
-
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
This may not return the entire NetBIOS computer name and in addition is output as all caps. Perhaps a Windows Hotfix or option has changed in the future? I tested in W7 LV2019 32bit.
It is better to call SystemExec with hostname
thus getting the exact computer name in full length as well as CaSe Sensitive results.