bcording Posted March 4, 2004 Share Posted March 4, 2004 How would you do it with out executing an external program? Is there a registry key? Some file? Link to comment Share on other sites More sharing options...
BobHansen Posted March 4, 2004 Share Posted March 4, 2004 Have you tried using NET USE? Hope this was helpful.............good luck, Bob Link to comment Share on other sites More sharing options...
bcording Posted March 4, 2004 Author Share Posted March 4, 2004 (edited) Net use would be executing an external command. The idea i just had was using URLDownloadToFile and grabbing a small item from an intranet page. $Connected = URLDownloadToFile("http://intranet.com/spacer.gif", @TempDir & "\tmp.gif") Edited March 4, 2004 by bcording Link to comment Share on other sites More sharing options...
Bartokv Posted March 4, 2004 Share Posted March 4, 2004 Probably the easist way would be to check the Macros "@IPAddress1" through "@IPAddress4" to see if the address is something other than "0.0.0.0" (invalid) or "127.0.0.1" (localhost). "@IPAddress1" should be the only one that you'd need to check in most cases.Please keep in mind that it's not the best way to test for connectivity, but it should be somewhat reliable. Link to comment Share on other sites More sharing options...
Josbe Posted March 4, 2004 Share Posted March 4, 2004 Or Ping command? AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
bcording Posted March 4, 2004 Author Share Posted March 4, 2004 Ping relies on executing an external program, something i want to avoid. The idea of looking at the IP address helps, but simply means you have an IP. The method i found using URLDownloadToFile is working fine. Thanks all. Link to comment Share on other sites More sharing options...
scriptkitty Posted March 4, 2004 Share Posted March 4, 2004 If you are trying to check LAN connection, use any file checking function to any on the server or anouther workstation share. If you wish to Check WAN or internet, URLDownloadToFile() is a nice AutoIt only solution. I prefer to use ping though, fast and reliable. JdeB posted a small one I think: ; Run ping with count=1 and timeout = 1 second $rc = RunWait(@comspec & ' /c ping 192.168.100.100 -n 1 -w 1000','',@SW_HIDE) If $rc = 0 Then ; host exists Else ; host doesn't exists EndIf AutoIt3, the MACGYVER Pocket Knife for computers. 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