Search code examples
powershellcmdsolr

Start solr server in terminal works but not in cmd


I'm trying to start a Solr server in cloudmode by writing this command in my:

cmd ./bin/solr start -c -p 8983 -s example/cloud/node1/solr

It works when I do it in the terminal (Windows PowerShell) but not via cmd. It made me curious why it is this way. I have not find any solutions on the internet.

The error message I get in CMD is:

'.' is not recognized as an internal or external command, operable program or batch file

Does anyone have any idea what can cause this problem? And yes I'm in the right dir and have started cmd as administrator.

I tried using the command

./bin/solr start -c -p 8983 -s example/cloud/node1/solr

In both admin and not admin mode of CMD. I tried without the dot as well.


Solution

    • PowerShell allows interchangeable use of \ and / as the path separator.

    • cmd.exe does not: it only recognizes \ in program paths, as well as in its internal commands such as dir.

    Therefore:

    .\bin\solr start -c -p 8983 -s example/cloud/node1/solr
    

    Note that I'm assuming that the specific CLI you're calling, solr, does accept /, which is implied by the fact that the original command works as-is in PowerShell.