- Put this code in your bat file
- It’ll start and activate the mongodb in 2 different admin privileged cmd windows.
- Please check the paths before to adjust to your environment.
START “runas /user:administrator” cmd /K “cd C:\Program Files\MongoDB\Server\3.4\bin & mongod.exe –dbpath c:\data\db”
TIMEOUT /T 10 START
START “runas /user:administrator” cmd /K “cd C:\Program Files\MongoDB\Server\3.4\bin & mongo.exe “