Run bitcoind as a service in windows Motivation

I don't want to have to have bitcoin-qt running.
I want the control and error handling capabilities that come when something is running as a service.
I want bitcoind to start when windows starts in the event of a server downage

Notes
I want to service main and testnet, which I think won't be an issue since afaik bitcoind listens on both ports. I'm just mentioning this for more information.
Install

Download NSSM
Comment out #daemon=1 from bitcoin.conf with comment #incompatible with windows service
Shut down bitcoin-qt, bitcoind, bitcoin-cli to eliminate any confusion
nssm install BitcoinCore &quot;C:\Program Files\Bitcoin\daemon\bitcoind.exe&quot; -datadir=C:\Documents\Data\Bitcoin (use your own path of course)
nssm set BitcoinCore DisplayName Bitcoin Core
nssm set BitcoinCore Description Bitcoin node with a JSON-RPC server




Test

You should be able to see 8333 connections in netstat
You will see bitcoind in your task list under Details
If you go to Service(s), it will take you to this service.
bitcoin-qt still works even in testnet mode
bitcoin-cli still works even in -testnet
Your app still works even in testnet mode


Running mainnet and Testnet both
Repeat the steps for install, but on step 4, use
nssm install BitcoinCoreTestnet &quot;C:\Program Files\Bitcoin\daemon\bitcoind.exe&quot; -testnet=1 -datadir=C:\Documents\Data\Bitcoin

You will then be able to take requests for mainnet on port 8332 and testnet on port 18332