S
S
SurelL2018-06-25 11:38:52
cmd/bat
SurelL, 2018-06-25 11:38:52

What could be the reason for the cmd error?

Hello!
I am writing a batch file with this code:

@echo off
if java -jar "SOAPClientDummy02.jar" input.txt | find /i "Stubs on dummy02 work correctly" goto success
echo Something gooes with errors on dummy02
:success
echo Stubs on dummy02 work correctly
pause

When executing this batch file, an error occurs:
-jar was unexpected at this time
Tell me, please, what is the reason?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
res2001, 2018-06-25
@res2001

Because you have a java ... call in an if statement.
I didn't understand what you mean by that.
In any case, this is not correct - if cannot call external programs like in bash.
This is what is reported in the error, although the error may seem somewhat ridiculous at first glance, but on the second, everything is fine :-)

M
Max, 2018-06-25
@MaxDukov

quotes are lost. Do you want to process the execution code

java -jar "SOAPClientDummy02.jar" input.txt | find /i "Stubs on dummy02 work correctly"
? here it should be removed in quotation marks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question