Q:

running MongoDB using mongod.exe

I have the mongoDB works well in my computer . 
but every time I want to run it I should go to the CMD and type : 
c:\mongoDB\bin\mongod --dbpath c:\mongoDB\data\db

and if I close the CMD window the connection will ends up . 
So I'm wondering if I want to upload my App to online website , how should the mongoDB works !? Thank you    

A:

You can run mongodb as a Windows service
e.g. set up as a windows service
mongod --install --serviceName "MongoDB" --dbpath C:\mongodb\data\db 
       --logpath C:\mongodb\logs\mongolog.txt --logappend

Then you can start the service from CMD using:
net start mongodb

Or, you can start it via Control Panel -> Administrative Tools -> Services. You can then just set it to start automatically on Windows start.

