1. Create a new Data folder under D:\MongoDB
2. Create a new DB and log folder under D:\MongoDB\data
3. Create the Mongo.log file under D:\MongoDB\log
4, create a new mongod.cfg file under D:\MongoDB, add the following in the file
Logpath=D:\MongoDB\data\log\mongo.logdbpath=d:\mongodb\data\db
5. Run cmd as an administrator
6. Execute the following command in CMD
Microsoft Windows [version10.0.14393] (c) .Microsoft Corporation. All rights reserved. C:\windows\system32>d:d:\>CD D:\MongoDB\Server\3.4\bind:\mongodb\server\3.4\bin>mongod--config D:\MongoDB\mongod.cfg--Install .- A-06T20: -:12.481+0800I CONTROL [main] Logfile "D:\MongoDB\data\log\mongo.log"Exists Moved to"D:\MongoDB\data\log\mongo.log.2017-12-06T12-14-12".
D:\mongodb\server\3.4\bin>net Start MongoDB
MongoDB Service is starting:
MongoDB Service has started successfully.
D:\mongodb\server\3.4\bin>
7.MongoDB successfully set to Windows service
Start MongoDB as a system service for WINDOWS10