flywire wrote: ↑03 Jun 2018 02:58
sst wrote: ↑03 Jun 2018 02:09
XY Problem
How so?
Ignore this post if your are not interested to know how others may possibly interpret your post and how it is difficult to diagnose the problem and suggest solutions based on the kind of information that is provided.
In the next post I will try to diagnose and suggest a solution or at least try to narrow the search space to find the actual problem, It maybe wrong though because the information is not complete.
You have diagnosed the problem yourself and came to the conclusion that command processor is printing the blank lines to the screen then you decided to hide the details and just seeking for a solution of how to prevent command processor from printing blank lines, but didn't pay attention to the fact that the diagnostics maybe wrong and as a result others maybe put their efforts on solving a problem that is not the actual problem.
Even if the actual problem is what you think, the way you presented it does not suggest that to be true.
Let's start with your first post:
flywire wrote: ↑02 Jun 2018 05:41
I process thousands of files in a batch file with prog.exe ...
It just doesn't make sense. If someone unfamiliar with batch files sees this, hi/she would probably think that there are thousands of file references in a file called batch file which prog.exe is responsible for processing that batch file, But the ones who are familiar with subject can guess that prog.exe is somehow used inside of batch file but it is still unclear how that prog.exe is involved, what is it responsible for ? does it output something to the screen or it just do something to the files?
flywire wrote: ↑02 Jun 2018 05:41
and redirect output from the batch file to a log file
This part is clear (Maybe the only part)
flywire wrote: ↑02 Jun 2018 05:41
Each time the program is called the command processor prints a blank line to the shell.
At first glance this means that the program (prog.exe) is called from inside batch file and all of output of the batch file is redirected to a log file but despite the redirection it still prints blank lines to the console. It seems to be somewhat clear to this point (by guess) but since you related blank line output to calling the prog.exe it is still unclear why you made command processor responsible for printing the blank line to the console. How do you know the blank line is printed by command processor but not prog.exe. You didn't provide any evidence for your claim so others just have to guess or not relay on the incomplete and probably wrong information you provide. (Note that your later explanations made this even more vague and I personally can't decide with certainty what your actual problem is.)
Then comes the superuser site link refrence
flywire wrote: ↑02 Jun 2018 05:41
I found
https://superuser.com/a/97308/514126
> set /p x=foo<nul
foo
> _
When I use it it just prints the program name 'prog' rather than running the program.
How can I suppress the blank lines in the shell?
You described that you've tried one of the solutions that is provided by that link. But It added even more to the confusion, just so you know. It is obvious that the solution you tried is not a solution at all but it is trowing out the question what you were trying to achieve with that? you probably was seeking the type of output that is provided by set /p but the thing your were seeking with set /p it is completely unrelated to what you have described before.
The question and answer on that link, Just trapped you in the in the same situation that you have created here yourself, and that's not your fault.
If it was to me I would down-vote both the answer and question on that link to at-least
-1000 and prevented it to be indexed by search engines. Why? because The question does not provide any useful information or code samples to describe what the actual problem is. It is open to be interpreted in many ways, And the one who answered it just made an educated guess on what the questioner is seeking for and it just happened to be what he/she wanted and most probably in the wrong way.
Based on the text of the question which have no further details, you thought that it is addressing the very same problem you have. That's the problem with this kind of questions and answers.
I hope you see were it is going by providing incomplete and vague information on the problem. No one can read your mind and see the actual problem behind. You have to provide it yourself.