<p>Using the info @Prayank provided, I managed to do it the following way:</p>
<p>Run first cmd session and changed directory to where <code>bitcoind.exe</code> resides. Then run <code>bitcoind.exe</code></p>
<p>Run second cmd session, changed directory to the same one as above and then run</p>
<p><code>bitcoin-cli loadwallet directory_where_wallet.dat_resides</code></p>
<p><code>bitcoin-cli encryptwallet &quot;my pass phrase&quot;</code></p>

CC BY-SA 4.0
2021-12-30T10:57:06.420Z
2021-12-30T10:57:06.420Z
mikest
<p>Is there a way to insert a password to a wallet.dat file from windows cmd?</p>
<p>I'm a newbie, so please be as specific as you can.</p>
<p>That wallet.dat file needs rescan, which I want to make after I insert the password. This I can't do from bitcoin core gui (version 0.22), since once running it starts rescanning immediately and so no menu appears and I can't do anything till it's finished the rescan.</p>
<p>Thanks</p>

<bitcoin-core><bitcoin-cli><windows><rescan>
Insert a password to a wallet.dat file from windows cmd
mikest
# Insert a password to a wallet.dat file from windows cmd

(Asked by: username_0 on 2021-12-29)

Is there a way to insert a password to a wallet.dat file from windows cmd?

I'm a newbie, so please be as specific as you can.

That wallet.dat file needs rescan, which I want to make after I insert the password. This I can't do from bitcoin core gui (version 0.22), since once running it starts rescanning immediately and so no menu appears and I can't do anything till it's finished the rescan.

Thanks

**Tags:** bitcoin-core, bitcoin-cli, windows, rescan


---

## 1 answers

### Answer by username_0 on 2021-12-30. Score: 2 | Accepted answer

Using the info @Prayank provided, I managed to do it the following way:

Run first cmd session and changed directory to where `bitcoind.exe` resides. Then run `bitcoind.exe`

Run second cmd session, changed directory to the same one as above and then run

`bitcoin-cli loadwallet directory_where_wallet.dat_resides`

`bitcoin-cli encryptwallet "my pass phrase"`


---

