Sign in to follow this  
Followers 0
ioctl

Is that possible ?

8 posts in this topic

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 !

Share this post


Link to post
Share on other sites



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 OK

If $file = -1 Then

    MsgBox(0, "Error", "Unable to find Settings.txt file")

    Exit

EndIf

; Read in lines of text until the EOF is reached

While 1

    $line = FileReadLine($file)

    If @error = -1 Then ExitLoop

    MsgBox(0, "Line read:", $line)

Wend

FileClose($file)

Sleep ( 3000 )

SplashTextOn("", "Configuring your Access Point...", 230, 18, -1, 130, 1, "", 10)

Run("telnet.exe" & $line )

WinWaitActive ( "Telnet " & $line)

Thanks , P.K.

Share this post


Link to post
Share on other sites

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.


.

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by ioctl

Share this post


Link to post
Share on other sites

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

<{POST_SNAPBACK}>

Insert a space after telnet.exe, Eg:

Run("telnet.exe " & $line)

Roy :)

Share this post


Link to post
Share on other sites

It doesnt work Roy. I tried it.

Cannot recognize "& $line"

Any other ideas?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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!

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  
Followers 0