<p>While you have <code>bitcoind</code> or <code>bitcoin-qt</code> running with the <code>-server</code> option, you can then use <code>bitcoin-cli</code> to run commands.</p>

<p>It's part of the bitcoind package.</p>

<p>If you have your conf file in a custom directory you'll have to specify that to bitcoin-cli as well, otherwise it should just work.</p>

CC BY-SA 3.0
2016-04-13T08:29:21.957Z
You'll also need to run bitcoin-qt with the -daemon option, or run bitcoind.
Pieter Wuille
CC BY-SA 3.0
2016-04-13T10:28:16.967Z
thx, answer updated to make that clear.
Jannes
CC BY-SA 3.0
2016-04-14T07:57:34.300Z
Oops, the answer below corrects me: you need -server, not -daemon (which is for running in the background).
Pieter Wuille
CC BY-SA 3.0
2016-04-13T08:21:52.613Z
2016-04-14T11:56:32.700Z
2016-04-14T11:56:32.700Z
Jannes
<p>The easiest way to do what you are trying to do is add one line to your <a href="https://github.com/bitcoin/bitcoin/blob/master/contrib/debian/examples/bitcoin.conf" rel="nofollow noreferrer">bitcoin.conf</a> file.  </p>

<blockquote>
  <p>server=1</p>
</blockquote>

<p>The file exists in one of these locations: "<a href="https://bitcoin.stackexchange.com/questions/11190/where-is-the-configuration-file-of-bitcoin-qt-kept">Where is the configuration file of bitcoin qt kept</a>"</p>

<p>You are also required configure a username and password when you do this by adding these additional lines. Always use a new secure random password that is unique to only this service (don't re-use it anywhere, and don't commit it to a source code repository) </p>

<blockquote>
  <p>rpcuser=Ulysseys
  rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593</p>
</blockquote>

<p>You can now run the bitcoin-cli.exe command from cmd.exe (it is installed in c:\program files\bitcoin\daemon) </p>

<p>It is also worth noting that you do not have to run bitcoin-qt you can choose to run bitcoind and interact with bitcoin-cli as well.  </p>

CC BY-SA 3.0
2016-04-14T03:37:39.283Z
2016-04-14T03:37:39.283Z
2017-04-13T12:47:33.610Z
Mark S.
<p>Is there a way to interact with Bitcoin-qt from Windows cmd and run commands like if I'm running them from Bitcoin-qt console?</p>

<bitcoin-core><windows><command-line-options>
Bitcoin-qt console on cmd
Marco
# Bitcoin-qt console on cmd

(Asked by: username_0 on 2016-04-13)

Is there a way to interact with Bitcoin-qt from Windows cmd and run commands like if I'm running them from Bitcoin-qt console?

**Tags:** bitcoin-core, windows, command-line-options


---

## 2 answers

### Answer by username_1 on 2016-04-13. Score: 2 | Accepted answer

While you have `bitcoind` or `bitcoin-qt` running with the `-server` option, you can then use `bitcoin-cli` to run commands.

It's part of the bitcoind package.

If you have your conf file in a custom directory you'll have to specify that to bitcoin-cli as well, otherwise it should just work.

> **Comments:**
> **username_2**: You'll also need to run bitcoin-qt with the -daemon option, or run bitcoind.  
> **username_1**: thx, answer updated to make that clear.  
> **username_2**: Oops, the answer below corrects me: you need -server, not -daemon (which is for running in the background).  

---

### Answer by username_3 on 2016-04-14. Score: 0

The easiest way to do what you are trying to do is add one line to your [bitcoin.conf](https://github.com/bitcoin/bitcoin/blob/master/contrib/debian/examples/bitcoin.conf) file.

> server=1

The file exists in one of these locations: "[Where is the configuration file of bitcoin qt kept](https://bitcoin.stackexchange.com/questions/11190/where-is-the-configuration-file-of-bitcoin-qt-kept)"

You are also required configure a username and password when you do this by adding these additional lines. Always use a new secure random password that is unique to only this service (don't re-use it anywhere, and don't commit it to a source code repository)

> rpcuser=Ulysseys
> rpcpassword=YourSuperGreatPasswordNumber\_DO\_NOT\_USE\_THIS\_OR\_YOU\_WILL\_GET\_ROBBED\_385593

You can now run the bitcoin-cli.exe command from cmd.exe (it is installed in c:\program files\bitcoin\daemon)

It is also worth noting that you do not have to run bitcoin-qt you can choose to run bitcoind and interact with bitcoin-cli as well.


---

