Hello,
When you change environment variables they will not have an effect on the currently-installed RabbitMQ windows service. I suggest using the RABBITMQ_BASE variable in this manner:
Open the "RabbitMQ Command Prompt (sbin dir)" start menu item and run these commands:
.\rabbitmq-service.bat stop
.\rabbitmq-service.bat remove
Then, set a system-wide environment variable RABBITMQ_BASE pointing to the directory of your choice. I suggest something like C:\ProgramData\RabbitMQ. You would then put your configuration file (rabbitmq.conf) in that directory. Other RabbitMQ directories will be created there when the service starts up. However, if you wish to preserve existing configuration you would copy all of the files and directories from %AppData%\RabbitMQ to C:\ProgramData\RabbitMQ at this time.
Then, open a new "RabbitMQ Command Prompt (sbin dir)" prompt and run the following. The first echo command is to verify that the new variable has been set correctly:
echo %RABBITMQ_BASE%
.\rabbitmq-service.bat install
.\rabbitmq-service.bat start
At this point, you can then check the log file to ensure that the expected configuration file was loaded. There will be a log line that looks like this:
config file(s) : c:/ProgramData/RabbitMQ/rabbitmq.conf
If you set RABBITMQ_BASE prior to the initial installation of RabbitMQ it will be picked up during install time.
None of these settings affects the Erlang cookie file location. For the user who runs rabbitmqctl.bat commands via the "RabbitMQ Command Prompt (sbin dir)" prompt the cookie must be in C:\Users\USERNAME\.erlang.cookie and it must match the cookie used by RabbitMQ and stored in C:\Windows\system32\config\systemprofile\.erlang.cookie
Please see https://www.rabbitmq.com/cli.html#cookie-file-locations for more information about the cookie.
Thanks,
Luke