Post
Topic
Board Development & Technical Discussion
Re: Can't import keys - unexpected token 'importprivkey'
by
webchris
on 23/12/2017, 18:51:06 UTC
Thanks for the reply! So I switched my batch file to use bitcoin-cli instead of bitcoind and I'm no longer getting the errors as before. Though, it doesn't actually add keys to my Bitcoin Core wallet. I'm clearly missing a step.

So here's what I'm doing. I have Bitcoin Core on my Windows PC. I have tried this with it closed and open, same results. I have to run bitcoind in one command prompt (to get bitcoin-cli to work). I run a command like this in a batch:

Code:
"C:\Program Files\Bitcoin\daemon\bitcoin-cli.exe" importprivkey "MYKEYHERE" "label1" false

It gives no error. When I open/check Bitcoin Core, there are no additional addresses added. I know I could add them individually using Core's console, but I need a batch file since I have many addresses to add and wouldn't be able to do them one-by-one.