Sign in to follow this  
Followers 0
MAS

Include text to script output

4 posts in this topic

-------------------------------------------------------------- -------------------------------------------------------------- hello all

i have ascript to output ip of hostname into text file but i want to include some other static text with it

the script :

--------------------------------------------------------------

TCPStartup()

$ip = TCPNameToIP("google.com")

$txtfile = Fileopen ( "ip.txt" ,2)

FileWrite($txtfile, $ip)

--------------------------------------------------------------

i wish to include some text before , after and in the same line of the ip

like that :

--------------------------------------------------------------

text line 1

text line 2

ip is (ip of google goes here)

text line 4

text line 5

--------------------------------------------------------------

any help appreciated

thanks all :mellow:

Share this post


Link to post
Share on other sites



$ip = TCPNameToIP("google.com")
$txtfile = Fileopen ( "ip.txt" ,2)
$Text = "" & _
  "text line 1" & @CR & _
  "text line 2" & @CR & _
  $ip & @CR & _
  "text line 4" & @CR & _
  "text line 5"
FileWrite($txtfile, $Text)


Ever wanted to call functions in another process? ProcessCall UDFConsole stuff: Console UDFC Preprocessor for AutoIt OMG

Share this post


Link to post
Share on other sites

ok Shaggi thanks alot

but do you know how to include some text before the $ip

to output

"ip is xx.xx.xx.xx"

sorry but I'm very beginner

Share this post


Link to post
Share on other sites

the code

TCPStartup()
$ip = TCPNameToIP("google.com")
$txtfile = Fileopen ( "ip.txt" ,2)
$Text = "" & _
  "text line 1" & @CR & _
  "text line 2" & @CR & _
  "ip is " & $ip & @CR & _
  "text line 4" & @CR & _
  "text line 5"
FileWrite($txtfile, $Text)

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