Jump to content

getting remote system name


bornem
 Share

Recommended Posts

I call the script from different servers, I "know" the info but do not want to hardcode ip, or hostname into the program. What I'm hoping for is a way to grab the hostname or even ip address of the system the autoit script is running from.

Link to comment
Share on other sites

You have a couple of options.

First you could use a UDP broadcast, but I have never written one myself. Basically there is a way to send a packet to all computers attached to a network switch. Your program would listen for this packet and reply with its IP address when it hears it.

Second, your program could take a command line parameter or read an INI file to get the Hostname/IP. This would allow you to change it without recompiling your script.

Third, you could scan the network for a system running your script. Just start at xxx.xxx.xxx.1 and start moving up to xxx.xxx.xxx.255 until you find the correct one.

Hope this helps.

Link to comment
Share on other sites

@weaponx

But that will just give the local computer's name and ip.. he wants it for a remote pc..

Edited by Manjish
[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Link to comment
Share on other sites

@weaponx

But that will just give the local computer's name and ip.. he wants it for a remote pc..

This is what he said:

What I'm hoping for is a way to grab the hostname or even ip address of the system the autoit script is running from.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...