I moved my blockchain directory, including bitcoin.conf, to an external drive D:\Bitcoin. Bitcoin Core starts and runs normally using this path, however when I try to use the command line interface, even when I specify the new directory, I keep running into this error.

C:\Program Files\Bitcoin\daemon>bitcoin-cli -datadir=D:\Bitcoin -getinfo 

   error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is  not set. See -rpcpassword and -stdinrpcpass.

I know that the issue is that bitcoin-cli is still looking in the default directory C:\Users\<username>\AppData\Roaming\Bitcoin because when I copy the auth .cookie and bitcoin.conf files to to old directory my commands work.

Wondering if the -datadir flag is not working properly, if I made an error somewhere, or if there is another way to fix this? I have also tried using the -conf=D:\Bitcoin\bitcoin.conf flag, however that does not fix either.

Windows 10

  • 1
    Have you tried putting quotes around the datadir, e.g. -datadir="D:\Bitcoin"?
    – Ava Chow
    Jan 19, 2021 at 5:30

1 Answer 1


As Andrew Chow suggested, the solution was simply putting quotes around the directory path. Windows SMH. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.