ioctl Posted June 28, 2005 Share Posted June 28, 2005 I have a test.txt file that only includes a number. example : 192.168.1.1 I want to make a program that every time i run it to show me the number of the test.txt even if i change that number every time. Is that possible?? Example : My ip is "192.168.1.1" Thanks friends. Great job with autoIT ! Link to comment Share on other sites More sharing options...
ioctl Posted June 28, 2005 Author Share Posted June 28, 2005 Actually my problem is not to read from the file but the following:I cant open telnet with $line.$file = FileOpen("Settings.txt", 0); Check if file opened for reading OKIf $file = -1 Then MsgBox(0, "Error", "Unable to find Settings.txt file") ExitEndIf; Read in lines of text until the EOF is reachedWhile 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop MsgBox(0, "Line read:", $line)WendFileClose($file)Sleep ( 3000 )SplashTextOn("", "Configuring your Access Point...", 230, 18, -1, 130, 1, "", 10)Run("telnet.exe" & $line )WinWaitActive ( "Telnet " & $line)Thanks , P.K. Link to comment Share on other sites More sharing options...
quick_sliver007 Posted June 28, 2005 Share Posted June 28, 2005 Actually my problem is not to read from the file but the following:I cant open telnet with $line.Thanks , P.K.<{POST_SNAPBACK}>From what I am seeing. You want to open a file in telnet.exe. If so then do Run("telnet.exe") then send some keystokes to the telnet.exe to open the file in the program.The run function only opens the Exe. Like if you run notepad.exe and want it to open a document, you have to tell notepad to open the document, not the run function.I hope this what you where asking. . Link to comment Share on other sites More sharing options...
ioctl Posted June 28, 2005 Author Share Posted June 28, 2005 (edited) Thanks sliver for your fast reply. Example to understand better what i want. : I want to telnet to 192.168.1.1. I also have a settings.txt file that includes the ip 192.168.1.1 If I make it with normal conditions it will be like this : Run("telnet.exe 192.168.1.1) But what i want is to read from the txt file the ip and be like this : Run("telnet.exe" & $line) Is that possible? Thanks again Edited June 28, 2005 by ioctl Link to comment Share on other sites More sharing options...
roy Posted June 28, 2005 Share Posted June 28, 2005 Thanks sliver for your fast reply.Example to understand better what i want. :I want to telnet to 192.168.1.1.I also have a settings.txt file that includes the ip 192.168.1.1If I make it with normal conditions it will be like this : Run("telnet.exe 192.168.1.1)But what i want is to read from the txt file the ip and be like this :Run("telnet.exe" & $line)Is that possible? Thanks again<{POST_SNAPBACK}> Insert a space after telnet.exe, Eg:Run("telnet.exe " & $line)Roy Link to comment Share on other sites More sharing options...
ioctl Posted June 28, 2005 Author Share Posted June 28, 2005 It doesnt work Roy. I tried it. Cannot recognize "& $line" Any other ideas? Link to comment Share on other sites More sharing options...
roy Posted June 28, 2005 Share Posted June 28, 2005 It doesnt work Roy. I tried it. Cannot recognize "& $line"Any other ideas?<{POST_SNAPBACK}>This work on my computer. Try It.Roy TelnetTest.au3 Link to comment Share on other sites More sharing options...
ioctl Posted June 28, 2005 Author Share Posted June 28, 2005 Nice!! I make it to work with a external file too! $file = FileOpen("Settings.txt", 0) Dim $host = FileReadLine($file) Run("telnet.exe " & $host) Thanks Roy! 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