bornem Posted February 17, 2009 Posted February 17, 2009 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
Manjish Posted February 17, 2009 Posted February 17, 2009 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
bornem Posted February 17, 2009 Author Posted February 17, 2009 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.
Prab Posted February 17, 2009 Posted February 17, 2009 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. FolderLog GuiSpeech Assist
bornem Posted February 17, 2009 Author Posted February 17, 2009 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.
weaponx Posted February 17, 2009 Posted February 17, 2009 (edited) @IPAddress1@ComputerNameMacros Edited February 17, 2009 by weaponx
Manjish Posted February 17, 2009 Posted February 17, 2009 (edited) @weaponx But that will just give the local computer's name and ip.. he wants it for a remote pc.. Edited February 17, 2009 by Manjish [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com
weaponx Posted February 17, 2009 Posted February 17, 2009 @weaponxBut 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now