
AvN
Members-
Posts
15 -
Joined
-
Last visited
AvN's Achievements

Seeker (1/7)
0
Reputation
-
There is no error message, but I noticed that " L-ToolsKllg" folder is not beeing created. and it is not copying the file => filecopy(@ScriptFullPath,$location&"L-ToolsKllg"&@scriptname,1)
-
There is no error message, but I noticed that " L-ToolsKllg" folder is not beeing created. and it is not copying the file => filecopy(@ScriptFullPath,$location&"L-ToolsKllg"&@scriptname,1)
-
Sorry, I forgot the attachments kl_try.au3
-
Hi, I have some code here (part of a program) that worked well with windows xp. Now I am using windows 7, I am not sure why this is not working as expected. could some one a look and help me? Does it have to do with 64bit, 32 bit system? what to fix here and how? Thank you.
-
Hi there, I am having a real problem here since yesterday. I wrote a program to open cmd.exe. When this is opened I will use telnet to connect to a device. When the connection is made, I am sending a series of command. Each command should output couple of lines. And I am suppose to save those line in a separate file. My problem is how to read those line from cmd.exe window and send them to the file that I create. Here is what I tried: $logFile =("C:\Documents and Settings\My Documents\log\logfile.txt") Run ("C:\WINNT\system32\CMD") ;opening cmd WinWaitActive ("C:\WINNT\system32\CMD.exe") sleep(1000) Send ("telnet 100.03.100.21{enter}") ; connecting via telnet Sleep (2000) WinWait ("C:\WINNT\system32\CMD.exe - telnet 100.03.100.21"); wait until connection is made _FileWriteLog($logFile, "Testing Start Here") ; creating a log file sleep (500) Send ("< shared/vx_dvt.sh{enter}"); send first command to communicate with the device Sleep (2000) Send ("DVT_PRO_Menu{enter}") ; sending another command to get the menu from the device sleep (4000) Send ("32{enter}") ; another command Sleep (2000) send ("4000{enter}") ; another command Sleep(2000) Send ("42{enter}") ; another command Sleep (2000) Send ("30{enter}") ; another command Sleep (2000) Now, my real problem is how to take what each command is giving me and send it to the file created, logFile? for example by sending 32 or 42, this gives me couple of lines. Example send ("32{enter}") will say: Ther required temperature at this level is 50 degree. Now how to save those words in my logFile? Thank you for your help.
-
Reading from the screen and send it to log file
AvN replied to AvN's topic in AutoIt General Help and Support
Thank you, this really helps. But how to open 2 commands at the same time so that I can get their contents in the file at the same time. For example for HELP this is what is done. Local $console = Run(@ComSpec & " /c HELP", @TempDir, @SW_SHOW, $STDERR_CHILD + $STDOUT_CHILD) How can I add HELP AT command so that when HELP finish opening, HELP AT will also open in the same console and its sent to the same file as the content of HELP command? Thanks. -
Reading from the screen and send it to log file
AvN replied to AvN's topic in AutoIt General Help and Support
Thank you for replying, I tried but looks like I am not getting it right. It doesn't work. I understand that with run.... the command HELP is beign sent. Now is @TempDir the directory where it is being written? How do I sent it to temperary file I create by my myself. How do I sent it to C:\Documents and Settings\Av\My Documents\temp\tempfile.txt? so that I can read it there? Thanks. -
Hi, Quick question:I am trying to run an application using cmd.exe. How can I get the content of the commands that I have executed, from the screen and send it to a file? Here is what I have try,Just an example, but it seems not to work #include <file.au3> $tempFile = ("C:\Documents and Settings\Avul\My Documents\temp\tempfile.txt"); creating a temp file Local $console = Run ("C:\WINNT\system32\CMD, $STDERR_CHILD + $STDOUT_CHILD") Run ("C:\WINNT\system32\CMD") ;opening cmd WinWait ("C:\WINNT\system32\CMD.exe") sleep(1000) MsgBox(0, "","Console opened",2) Send ("Help{enter}") ; sending a command ;in the following lines I am trying to take what ("Help{enter}") had put on the screen and send it to the tempfile Local $line While 1 $line = StdoutRead($console) If @error Then ExitLoop MsgBox(0, "STDOUT read:", $line) Wend $line = StdoutRead ("C:\WINNT\system32\CMD.exe") ;FileWrite($tempFile, $line) _FileWriteLog ($tempFile, $line) Your help will be much appreciated. AvN
-
Hi, Quick question:I am trying to run an application using cmd.exe. How can I get the content of the commands that I have executed, from the screen and send it to a file? Here is what I have try,Just an example, but it seems not to work #include <file.au3> $tempFile = ("C:\Documents and Settings\Avul\My Documents\temp\tempfile.txt"); creating a temp file Local $console = Run ("C:\WINNT\system32\CMD, $STDERR_CHILD + $STDOUT_CHILD") Run ("C:\WINNT\system32\CMD") ;opening cmd WinWait ("C:\WINNT\system32\CMD.exe") sleep(1000) MsgBox(0, "","Console opened",2) Send ("Help{enter}") ; sending a command ;in the following lines I am trying to take what ("Help{enter}") had put on the screen and send it to the tempfile Local $line While 1 $line = StdoutRead($console) If @error Then ExitLoop MsgBox(0, "STDOUT read:", $line) Wend $line = StdoutRead ("C:\WINNT\system32\CMD.exe") ;FileWrite($tempFile, $line) _FileWriteLog ($tempFile, $line) Your help will be much appreciated. AvN
-
Thank you, this helps. AvN
-
Hi there, Quick question: I am trying to come up with a script that read some data and create a txt log file for that. Say I have to read $temp1, $temp2,Temp3 from the script. How can I send it to the log file so that I can have it like this: Temperature1| Temperature2|Temperature3| $temp1 | $Temp2 |$Temp3 | With temperature1,2,3 being the title for each column and $temp1,2,3 being the values read. I tried this but I can't go far. _FileWriteLog($logFile,$Temp1) Your help is needed (a bit urgent !!! sorry.) Thank you.
-
Thanks a lot. @TAB works. You are the man.
-
Hi I tried $avParts = StringSplit($sLine, " "), it is not accepting " " but it is accepting "" (without space). But again in this case it reading just 1 character at a time. for eg. $avParts[6]is ":". So it is starting at 18:23:00, the 6th character here is ":" But I want it to read a value for eg. -39.2 (at once). I am trying to open the file with excel and real cells, but how to get the last line in excel. The difficulty is that my data may stop at line 200 of excel sheet but the same sheet may have 2000 lines. How to make the script stop reading where at the last line of my data and not at the last line of excel itself? More help needed.
-
Here is how the last line look like (exactly): 18:23:00 -39.0 -39.2 -38.4 -38.8 -39.2 -39 -41 So the question is from this line, how can I make the script to read just the data in colum 6 (which is-39.2). the first column is the time. This is easily done in Autohotkey by using A-index and A-Loopfield, but I can't see how to doit in Autoit. Thank you for your help.
-
Hi, I am new to Autoit. I have to open a txt file where I have data, read the last line; and in the last line read the element of column 6. $file= FileOpen ("C:Test.txt",0) If $file = -1 Then Beep(500, 700) MsgBox(16, "Error", "Unable to open file.") Exit EndIf $last_line = FileReadLine ($file, -1) MsgBox (0,"Finish reading", $last_line, 1) Sleep (200) From here it gives me the last line where I have columns and rows, so I have to extract the data in column 6. How I do it. I tried to open the file with excel, but as you can imagine the last line of excel is always empty... Your help will be appreciated. AvN