user50886: I'm trying to connect to a Bitcoin Core on Windows 10. I start it with this command:
.\bitcoin-qt.exe --server --rest --rpcport=54352 --rpcuser=admin --rpcpassword=admin123

Using netstat -an I see that it indeed is listening on requested port
TCP    127.0.0.1:54352        0.0.0.0:0              LISTENING

However, trying to connect with bitcoin-cli using this command:
.\bitcoin-cli.exe getinfo --rpcport=54352 --rpcuser=admin --rpcpassword=admin123

results in this error:
error: couldn't connect to server

What am I doing wrong?

user48884: The --* arguments to bitcoin-cli should come before the RPC command. Those arguments are for bitcoin-cli itself. However the position you put them in are positions for the getinfo RPC command and not bitcoin-cli. You should instead be using the following command:
.\bitcoin-cli.exe --rpcport=54352 --rpcuser=admin --rpcpassword=admin123 getinfo


50886: <p>I'm trying to connect to a <code>Bitcoin Core</code> on Windows 10. I start it with this command:</p>

<pre><code>.\bitcoin-qt.exe --server --rest --rpcport=54352 --rpcuser=admin --rpcpassword=admin123
</code></pre>

<p>Using <code>netstat -an</code> I see that it indeed is listening on requested port</p>

<pre><code>TCP    127.0.0.1:54352        0.0.0.0:0              LISTENING
</code></pre>

<p>However, trying to connect with <code>bitcoin-cli</code> using this command:</p>

<pre><code>.\bitcoin-cli.exe getinfo --rpcport=54352 --rpcuser=admin --rpcpassword=admin123
</code></pre>

<p>results in this error:</p>

<pre><code>error: couldn't connect to server
</code></pre>

<p>What am I doing wrong?</p>
 48884: <p>The <code>--*</code> arguments to <code>bitcoin-cli</code> should come before the RPC command. Those arguments are for <code>bitcoin-cli</code> itself. However the position you put them in are positions for the <code>getinfo</code> RPC command and not <code>bitcoin-cli</code>. You should instead be using the following command:</p>

<pre><code>.\bitcoin-cli.exe --rpcport=54352 --rpcuser=admin --rpcpassword=admin123 getinfo
</code></pre>
