The MongoDB service’s launching command path is stored in Windows Registry at the following path:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MongoDB\ImagePath
The configuration path is set as the --config
argument of the launching command, e.g.:
C:\server\mongodb\bin\mongod.exe --config "C:\server\mongodb\cfg\mongod.cfg" --service
Set the proper value there, and then restart the service.