How to run MongoDB as a service in Windows
In windows, the mongod server process run in a cmd window, when you opens a lot of windows, the switch becomes a problem. Its very nice to run the server as a service, so it run in background and you can make it start when Windows power up if you have a local web application based on MongoDB.
Looks like MongoDB release package didn't provide the tool to install windows service.
But the mongod.exe itself provided an option to install the service.
mkdir log echo logpath=D:\mongodb-win32-i386-2.4.3\log\mongo.log > mongod.cfg echo dbpath=D:\mongodb-win32-i386-2.4.3\data >> mongod.cfg mongod.exe --config D:\mongodb-win32-i386-2.4.3\mongod.cfg --install net start MongoDB
Check the service in Service Manager.
Now you don't have to manually start Mongod everyday.