Sign in to follow this  
Followers 0
bornem

getting remote system name

8 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

@IPAddress1

@ComputerName

Macros

Edited by weaponx

Share this post


Link to post
Share on other sites

#7 ·  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

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0