Jump to content

Recommended Posts

Posted

I run an Autoit script from remote systems. Does anyone know of a way to get the hostname of the remote system that the script is running from.

thanks

Posted

if u know the ip then yes there is a way..

TcpIpToName().. check in help file..

[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
Posted

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.

Posted

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.

Posted

I was able to figure it out using the _PathSplit call. It works perfectly by putting the different parts of the path the program is called from into an array.

Thanks.

Posted (edited)

@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
Posted

@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.

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
  • Recently Browsing   0 members

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