views:

27

answers:

1
  • I have a .net console application that runs a method called RunBatch() on 10 threads.
  • The method creates a process object and calls a .bat file.
  • The .bat file runs an instance of a tool called Lualatex - which is an exe that converts .tex files to .pdf files- and passes it the path of the .tex file to be converted. (e.g, Lualatex.exe "F:\file1.tex")
  • Sometimes the tool finds some errors in the .tex file format so it reports it on command prompt window running the tool.
  • The tool holds until a user responds to the message by clicking Enter then the tool goes ahead with the file in process.

All what I need is that -if applicable- make the response to this message happens automatically by the .net application without getting the tool waiting for a user to do it by hand.

Thanks in advance.

A: 

Finally I found a solution to this problem after reviewing the command line reference.

I found that the command prompt might receive the return key from either the keyboard manually or from a file, so I've created a text file called input.txt which contains only empty lines-by hitting the Enter key from the keyboard- and ran the batch this way:

Lualatex.exe "F:\file1.tex" <input.txt

Notice:The < before the file path means that the inputs needed by the exe running will be provided from the file specified. Also notice that the file is in the same path as the exe.

SubPortal