Created
December 4, 2014 22:28
-
-
Save frapontillo/0b76526772560f2371d9 to your computer and use it in GitHub Desktop.
MongoDB Batches for Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir %~dp0data\db | |
mkdir %~dp0log | |
echo logpath=%~dp0log\mongo.log >> "%~dp0mongod.cfg" | |
echo dbpath=C:\mongodb\data\db >> "%~dp0mongod.cfg" | |
sc.exe create MongoDB binPath= "\"%~dp0bin\mongod.exe\" --service --config=\"%~dp0mongod.cfg\"" DisplayName= "MongoDB" start= "auto" | |
net start MongoDB | |
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
net stop MongoDB | |
sc.exe delete MongoDB | |
rmdir %~dp0data /S /Q | |
rmdir %~dp0log /S /Q | |
rm %~dp0mongod.cfg | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment