user114324: 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

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

114324: <p>I moved my blockchain directory, including <code>bitcoin.conf</code>, to an external drive <code>D:\Bitcoin</code>. 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.</p>
<pre><code>C:\Program Files\Bitcoin\daemon&gt;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.
</code></pre>
<p>I know that the issue is that <code>bitcoin-cli</code> is still looking in the default directory <code>C:\Users\&lt;username&gt;\AppData\Roaming\Bitcoin</code> because when I copy the auth <code>.cookie</code> and <code>bitcoin.conf</code> files to to old directory my commands work.</p>
<p>Wondering if the <code>-datadir</code> 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 <code>-conf=D:\Bitcoin\bitcoin.conf</code> flag, however that does not fix either.</p>
<p>Windows 10</p>
 114323: <p>As Andrew Chow suggested, the solution was simply putting quotes around the directory path. Windows SMH. Thank you.</p>
