03-03-2005 10:02 AM
03-03-2005 10:31 AM
03-03-2005 11:16 AM
03-03-2005 11:18 AM
07-02-2011 06:19 AM
Sometimes, the user may donot have access to HKEY_LOCAL_MACHINE . In that case, we can use the following command to get the computer's name in the network.
SET USERDOMAIN
This command will return: USERDOMAIN=computername
07-02-2011 06:56 AM
cmd /a set userdomain
07-02-2011 10:33 AM
Of course the question is if this will really work in the above special cases where the plain LabVIEW method did not work for some reason. Have you tried?
(This is a 6+ year old thread, and many thing have probably changed)
07-02-2011 11:05 AM - edited 07-02-2011 11:06 AM
@karthikeyan90 wrote:
Sometimes, the user may donot have access to HKEY_LOCAL_MACHINE . In that case, we can use the following command to get the computer's name in the network.
SET USERDOMAIN
This command will return: USERDOMAIN=computername
This does not return the computer name. It returns the computers DOMAIN. If the PC is not part of a domain, it will return the PC name, but if part of a domain, this will not return the PC name. Your mathod should NEVER be used, as it is not guaranteed to work between computers.
The best method (in my opinion) is to use the WinAPI function GetComputerName.