How to override the location of registry directory without change CARGO_HOME

On my windows pc, $HOME.cargo directory contain four parts, include \bin, \registry, .package-cache, config.toml. As you know, \registry store \cache, \index, \src when execute the command "cargo metadata" from any rust project in the pc. I want to change the default location of the registry directory (maybe E:\registryRepo) without change the CARGO_HOME environment variable. Anyone who can help to figure out the solution.

Hm, I don't know if it'll work but you could try making a juncture point from registry to E:\registry. To do so delete (or move) the existing registry and open up cmd.exe. Then run something like this;

mklink /J "%CARGO_HOME%\registry" E:\registry

Replace %CARGO_HOME% with the full path if you don't have the environment variable set.

Thank you.