Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Quick script to create a windows servuice to run Mongo. Paths will need reviewing per install
--rmdir /s D:\MongoDB\Data
mkdir D:\MongoDB\Data\db
mkdir D:\MongoDB\Data\log
copy mongod.conf "D:\MongoDB\"
sc.exe delete MongoDB
sc.exe create MongoDB binPath= "\"%PROGRAMFILES%\MongoDB\Server\3.0\bin\mongod.exe\" --service --config=\"D:\MongoDB\mongod.conf\"" DisplayName= "MongoDB" start= "auto"
net start MongoDB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment