‘The syntax of the command is incorrect.’ while firing elasticsearch.bat for the first time

Recently I wanted to run ElasticSearch (here I wrote how to do it) on the fresh copy of Windows. So, I downloaded the package, typed


in CMD and I got this error:

The syntax of the command is incorrect.

If you also get this ‘meaningful’ message someday, check if you have java installed. If not, well, that’s the best moment to do so!


‘I installed java, the error still occurs!’

Slow down! Now, you need to close the CMD window. Then reopen it and inside the console, go to the ‘bin’ catalog of your ElasticSearch package and type elasticsearch.bat again. It will do :).


Featured image by Steven Welch


Share this: