{"id":1548,"date":"2013-06-07T11:21:28","date_gmt":"2013-06-07T03:21:28","guid":{"rendered":"http:\/\/me.doucl.com\/?p=1548"},"modified":"2013-06-07T11:21:28","modified_gmt":"2013-06-07T03:21:28","slug":"mongodb-cmd-vbs","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/nosql\/mongodb-cmd-vbs.html","title":{"rendered":"MongoDB\u542f\u52a8\u540e\u9690\u85cfCMD\u7a97\u53e3\uff0c\u5b9e\u73b0\u540e\u53f0\u8fd0\u884c(\u975e\u670d\u52a1\u542f\u52a8)"},"content":{"rendered":"

MongoDB\u7684Win\u5b89\u88c5\u5305\u5b9e\u9645\u4e0a\u662f\u4e00\u4e2a\u7eff\u8272\u7a0b\u5e8f\uff0c\u4e0b\u8f7d\u89e3\u538b\u540e\u76f4\u63a5\u5728\u547d\u4ee4\u884c\u4e0b\u9762\u53ef\u5b9e\u73b0\u542f\u52a8\u3002<\/p>\n

\u9ed8\u8ba4\u53c2\u6570\u542f\u52a8\uff1a<\/p>\n

D:\\xp\\mongodb\\bin\\mongod.exe<\/p>\n

\u8fd9\u6837\u867d\u7136\u80fd\u6b63\u5e38\u5de5\u4f5c\uff0c\u4f46\u662f\u5728MongoDB\u8fd0\u884c\u65f6\u59cb\u7ec8\u663e\u793a\u547d\u4ee4\u884c\u7a97\u53e3\u786e\u5b9e\u6709\u70b9\u4e0d\u65b9\u4fbf\u3002\u60f3\u5230\u5c06MongoDB\u6ce8\u518c\u4e3a\u670d\u52a1\u8fdb\u884c\u8fd0\u884c\uff0c\u8fd0\u884cmongod.exe -h\u53ef\u4ee5\u67e5\u5230\u76f8\u5173\u5b89\u88c5\u53c2\u6570\u547d\u4ee4\uff08–install)\uff0c\u8bd5\u4e00\u4e0b\u5b89\u88c5\u6210\u529f\uff0c\u4f46\u662f\u8fd0\u884c\u65f6\u603b\u662f\u63d0\u793a\u201c1053\u9519\u8bef\u201d\uff0c\u8bd5\u4e86\u51e0\u4e2a\u53c2\u6570\u914d\u7f6e\u59cb\u7ec8\u65e0\u6cd5\u6b63\u5e38\u542f\u52a8\uff0c\u53ea\u80fd\u53e6\u60f3\u529e\u6cd5\u4e86\u3002<\/p>\n

\u67e5\u8d44\u6599\u6709\u4eba\u5229\u7528VBS\u8c03\u7528\u6279\u5904\u7406\u6587\u4ef6\u5b9e\u73b0\u542f\u52a8\uff0c\u8bd5\u4e86\u4e00\u4e0b\u786e\u5b9e\u53ef\u4ee5\u3002\u4e3b\u8981\u662f\u5229\u7528\u201cWscript.Shell\u201d\u7684’run’\u547d\u4ee4\u548c’vbhide’\u53c2\u6570\u6765\u6267\u884c\u547d\u4ee4\u548c\u9690\u85cf\u7a97\u53e3\uff0c\u505c\u6b62\u8fdb\u7a0b\u4f7f\u7528’taskkill’\u547d\u4ee4\u3002\u4f18\u5316\u4e86\u4e00\u4e0b\u8be5\u65b9\u6848\u76f4\u63a5\u7528run\u547d\u4ee4\u6267\u884c\u542f\u52a8\u548c\u5173\u95ed\u8fdb\u7a0b\uff0c\u53e6\u5916\u91c7\u7528taskkill\u5f3a\u5236\u5173\u95edmongodb.exe\u8fdb\u7a0b\u4f1a\u5bfc\u81f4MongoDB\u975e\u6cd5\u5173\u95ed\uff0c\u65e0\u6cd5\u91cd\u65b0\u542f\u52a8\uff0c\u5982\u65e0\u6570\u636e\u4e22\u5931\u60c5\u51b5\u76f4\u63a5\u5220\u9664\u6570\u636e\u6587\u4ef6\u4e0b\u9762\u7684\u201cmongod.lock\u201d\u6587\u4ef6\u5373\u53ef\uff0c\u6d4b\u8bd5\u73af\u5883\u6ca1\u4ec0\u4e48\u592a\u5927\u95ee\u9898\uff0c\u53ea\u4e0d\u8fc7\u8981\u6ce8\u610f\u4fdd\u8bc1MongoDB\u5173\u95ed\u65f6\u6ca1\u6709\u6570\u636e\u6d3b\u52a8\u5373\u53ef\u3002<\/p>\n

\u542f\u52a8\u8fdb\u7a0b\u811a\u672c\uff1a<\/strong><\/p>\n

Set ws = CreateObject(\"Wscript.Shell\")\r\nws.run \"cmd \/c del D:\\data\\db\\mongod.lock\" , vbhide\r\nws.run \"cmd \/c D:\\XP\\mongodb\\bin\\mongod.exe\" ,vbhide<\/pre>\n<\/blockquote>\n
\n
\u505c\u6b62\u8fdb\u7a0b\u811a\u672c\uff1a<\/strong>\r\nSet ws = CreateObject(\"Wscript.Shell\")\r\nws.run \"cmd \/c taskkill \/f \/t \/im mongod.exe\" ,vbhide<\/pre>\n<\/blockquote>\n

\u53c2\u8003\u8d44\u6599:<\/strong><\/p>\n

http:\/\/www.fushanlang.com\/blog\/install-windows-mongodb-302\/<\/p>\n","protected":false},"excerpt":{"rendered":"

MongoDB\u7684Win\u5b89\u88c5\u5305\u5b9e\u9645\u4e0a\u662f\u4e00\u4e2a\u7eff\u8272\u7a0b\u5e8f\uff0c\u4e0b\u8f7d\u89e3\u538b\u540e\u76f4\u63a5\u5728\u547d\u4ee4\u884c\u4e0b\u9762\u53ef\u5b9e\u73b0\u542f\u52a8\u3002 \u9ed8\u8ba4\u53c2\u6570\u542f\u52a8\uff1a D: […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[74],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1548"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1548"}],"version-history":[{"count":2,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1548\/revisions"}],"predecessor-version":[{"id":1550,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1548\/revisions\/1550"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}