MikiiTakagi Posted April 5, 2019 Share Posted April 5, 2019 Hi! Im currently new to AutoIT Script, and programming in general. I just started doing some script during my free time at my job( Computer IT ). Im currently making a manager to see if everything is correct on some computer and one of them is the FTP. Im trying to get the info if the Port is open, passive and transfer IN/OUT. I just don't understand at all the FTP in AutoIT! I try the FTP_CONNECT function but all im able to do is connect without getting the info I need. I only need to know if the port is open for exemple. If someone could explain me a little it would be much appreciate! I love AutoIT and I would like to understand more to help the community! Thank You! PS: Sry for my bad english, it my second language. :S Link to comment Share on other sites More sharing options...
faustf Posted April 9, 2019 Share Posted April 9, 2019 i suggest : if you send a code is much better for comunity , help you (use a tag ) , for your problem i suggest , before read this https://stackoverflow.com/questions/20861843/check-if-ftp-server-is-passive-or-active-using-telnet and after use winscp you can bind in autoit , winscp is much powerful and support also sftp https://winscp.net/eng/docs/ftp_modes Link to comment Share on other sites More sharing options...
jvds Posted April 10, 2019 Share Posted April 10, 2019 you could connect to its port to see if it is open ConsoleWrite(@CR) ConsoleWrite(IpPortTest(@IPAddress1,21)&@CR) ConsoleWrite(IpPortTest(@IPAddress1,139)&@CR) ConsoleWrite(IpPortTest('192.168.100.300',21)&@CR) ConsoleWrite(IpPortTest(@IPAddress1,'tAsd')&@CR&@CR) func IpPortTest($ip,$port) TCPStartup() $socket = TCPConnect($ip,$port) $error = @error if $error then if $error = 10060 then Return 'Error : Connection timed out on ip:'&$ip&', port:'&$port if $error = 1 then Return '!Error : IPAddr: '&$ip&' is incorrect.' if $error = 2 then Return '!Error : port: '&$port&' is incorrect.' if $error = -2 then Return 'not connected.'; not sure when this one will trigger, no network conection? Else TCPCloseSocket($socket) Return '+Port:'&$port&' is open on IPAddr: '&$ip&' socket:'&$socket EndIf TCPShutdown() EndFunc Link to comment Share on other sites More sharing options...
MikiiTakagi Posted April 10, 2019 Author Share Posted April 10, 2019 Thank you for all the info! I just asked for where to start looking to do this functionality and with those respond I know where to start looking! Much Appreciate! Link to comment Share on other sites More sharing options...
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