Jump to content
Sign in to follow this  
bornem

getting remote system name

Recommended Posts

bornem

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
Manjish

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
bornem

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
Prab

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
bornem

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
weaponx

@IPAddress1

@ComputerName

Macros

Edited by weaponx

Share this post


Link to post
Share on other sites
Manjish

@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

@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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.