ur

how to get console output of batch file

5 posts in this topic

#1 ·  Posted

I am running the tomcat batch file through autoit   and need to wait until the below line I get in console output.

Capture1.JPG

But when I am trying to read the console output using the ProcessEx UDF, I am getting only the partial output.

So, can you please suggest how to handle this.

Share this post


Link to post
Share on other sites



#2 ·  Posted

Can you post a screenshot of the whole console you're reading and give the partial output you're getting, so we can see exactly what's happening? 

also some of your code would be nice

Share this post


Link to post
Share on other sites

#3 ·  Posted

It seems it is running another batch file internally..

 

I will share you the batch file

main file: startup.bat.txt

nested fle: catalina.bat.txt

 

The partial output: 

Using CATALINA_BASE:   "C:\Program Files\erwin\Mart Server r9\Tomcat64"
Using CATALINA_HOME:   "C:\Program Files\erwin\Mart Server r9\Tomcat64"
Using CATALINA_TMPDIR: "C:\Program Files\erwin\Mart Server r9\Tomcat64\temp"
Using JRE_HOME:        "C:\Program Files\erwin\Mart Server r9\Jre64"
Using CLASSPATH:       "C:\Program Files\erwin\Mart Server r9\Tomcat64\bin\bootstrap.jar;C:\Program Files\erwin\Mart Server r9\Tomcat64\bin\tomcat-juli.jar"

 

Share this post


Link to post
Share on other sites

#4 ·  Posted

It seems it is running another batch file internally..

 

I will share you the batch file

main file: startup.bat.txt

nested fle: catalina.bat.txt

 

The partial output: 

Using CATALINA_BASE:   "C:\Program Files\erwin\Mart Server r9\Tomcat64"
Using CATALINA_HOME:   "C:\Program Files\erwin\Mart Server r9\Tomcat64"
Using CATALINA_TMPDIR: "C:\Program Files\erwin\Mart Server r9\Tomcat64\temp"
Using JRE_HOME:        "C:\Program Files\erwin\Mart Server r9\Jre64"
Using CLASSPATH:       "C:\Program Files\erwin\Mart Server r9\Tomcat64\bin\bootstrap.jar;C:\Program Files\erwin\Mart Server r9\Tomcat64\bin\tomcat-juli.jar"

 

Share this post


Link to post
Share on other sites

#5 ·  Posted

Is there anyway to get the text of console window like a normal GUI window.

6.JPG

The windowinfo tool is not giving any visible/hidden 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

  • Similar Content

    • rinoatwisted
      By rinoatwisted
      Hello guys,
      im just started in programming and all..
      and i wanted to learn autoscript to.
      Was wondering if any can convert my  one-liner batch script to an autoit script -
      FOR /F %%i IN (names.txt) DO @copy system.act %%i.act
       
      So what this does is open and read the file "names.txt" incrementally, and copy a certain file named "system.act" and rename it to each name that is listed on "names.txt"
       
      So im trying this on autoit but no idea how to start file manipulation and do command -
       
      #include <File.au3>
      $file = "c:\names.txt"
      FileOpen($file, 0)
      For $i = 1 to _FileCountLines($file)
          $line = FileReadLine($file, $i)
       
      Can anyone help me or guide me on how to continue this to get the result that i want..:)?
      Thanks
    • fosil
      By fosil
      Hi everyone.

      I'm currently working a program that constantly prints out log files through "consolewrite" and the "#AutoIt3Wrapper_Change2CUI=y" wrapper.

      Part of this program requires me to run a batch script.

      My issue is the batch script launches from the same window as consolewrite. I need the batch file to be launched through a different window as currently this causes an issue with the logs (which need to be very precise) but also causes the batch file to produce some funny behavior...

      Does anyone know how I can force the file to run on a second DOS window?

      Thanks in advance!!!
       
      Edit: Im using the "run" command if that helps. I tried "shellexecute" but that seemed to not launch the batch scripts at all.
    • fopetesl
      By fopetesl
      I have several batch files, e.g.
      echo off echo !DT | ncat 192.168.1.6 80 > scan1.dta This data1.bat works as expected by saving data from !DT command.
      I have tried several variations from AutoIt
      ;  $DOS = RunWait(@ComSpec & " /k " & "ncat 192.168.1.6 80 <getdata >scan1.dta", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ;  $DOS = Run(@ComSpec & " /k " & "ncat 192.168.1.6 80 <getdata >scan1.dta", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) ;  $DOS = Run(@ComSpec & " /c " & "echo ?DT | ncat 192.168.1.6 80 > scan1.dta & @CRLF", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)   $DOS = Run(@ComSpec & " /c " & "data1.bat & @CRLF", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) but none save the data to scan1.dta
      Run out of ideas so far...
       
    • StMaSi
      By StMaSi
      If I am using a RunWait command to launch a batch file from within an AutoIt script, how can I pass a variable to said batch file so that the batch file can utilize said variable like in a %var% format? Thank you in advance.
    • PClough
      By PClough
      Hi everyone!
      I want to programmatically alter the structure of a large number of PDF which have different sizes and orientation, and come from different generators. To do this I need to be able to capture different parameters describing their layout.  I use a console tool called pdfInfo (part of the xpdf public domain suite) which provides me with everything I need. The idea is first to run pdfInfo against my pdf file redirecting the console's output to a text file. And then to load and parse the text file to get the parameters I need.  The only problem is that no output file is ever created.  I've looked through the forums and saw a number of threads loosely related to this but none of the suggested solutions (like using StdoutRead) has worked for me. I should say maybe that I'm running Win10.
      So here's the code that doesn't work:
      $pdfInfo = "f:\pdfinfo.exe" $pdfTest = "f:\test.pdf" RunWait(chr(34) & $pdfInfo & " -box " & $pdfTest & " > f:\log.txt", "", @SW_HIDE) If you use in a console the command line: 
      f:\pdfinfo.exe -box f:\test.pdf > f:\log.txt
      it works perfectly.  But the piece of code above does not create the log.txt file. So any idea what I am doing wrong.  Thanks for any help!