The instructions for manually creating a Windows service as a workaround to
SERVER-13515 do not work on Windows 2012 with the default Windows Power Shell. Even if you take care to quote the double quotes and include spaces in the right places, the sc.exe command will not accept the command. It will just spit out the usage statement instead of telling you what is wrong.
The documentation tells you to type this:
sc.exe create MongoDB binPath= "\"C:\Program Files\MongoDB 2.6 Enterprise\bin\mongod.exe\" --service --config=\"C:\Program Files\MongoDB 2.6 Standard\mongod.cfg\"" DisplayName= "MongoDB 2.6 Standard" start= "auto"
... but removing all extraneous double quotes by referring to directories with non-space filenames was the only way I could get it to work on Windows 2012:
sc.exe create MongoDB binPath= "c:\progra~1\mongod~1.6st\bin\mongod.exe --service --config=c:\progra~1\mongod~1.6st\mongod.cfg" DisplayName= "MongoDB 2.6 Standard" start= "auto"
This bug affects:
It will likely be a non-issue once 2.6.1 is generally available.
There is a proposed workaround on stackoverflow that suggests using environment variables in powershell like the following example, but I have not tried it: