{"id":2032,"date":"2022-11-15T16:26:42","date_gmt":"2022-11-15T08:26:42","guid":{"rendered":"http:\/\/www.tra56.com\/?p=2032"},"modified":"2022-11-15T16:26:42","modified_gmt":"2022-11-15T08:26:42","slug":"2032","status":"publish","type":"post","link":"https:\/\/www.tra56.com\/2032.html","title":{"rendered":"\u4f7f\u7528NSSM\u5b89\u88c5.exe\u6587\u4ef6\u6210Windows\u670d\u52a1\uff08.bat\u6587\u4ef6\u64cd\u4f5c\uff09"},"content":{"rendered":"

\u4e4b\u524d\u67e5\u5230\u7684nssm\u5b89\u88c5Windows\u670d\u52a1\u90fd\u662f\u7528 nssm install <servicename> \uff0c\u4f46\u662f\u4f1a\u5f39\u51fa\u7a97\u53e3\uff0c\u9700\u8981\u586b\u5199\u8def\u5f84\u53c2\u6570<\/span><\/span><\/p>\n

\u4f7f\u7528NSSM\u628a\u4efb\u610fexe\u7a0b\u5e8f\u6ce8\u518c\u6210Windows\u670d\u52a1<\/span><\/a><\/p>\n

\u4e0b\u9762\u4ecb\u7ecd\u4e00\u79cd\uff0c\u76f4\u63a5\u4f7f\u7528.bat\u547d\u4ee4\u5c31\u53ef\u4ee5\u5b9e\u73b0\u7684\u5b89\u88c5\u65b9\u5f0f\uff08\u672c\u6587\u4f7f\u7528\u7684.exe\u6587\u4ef6\u662f\uff0c.net core\u9879\u76ee\u53d1\u5e03\u7684\u4e00\u4e2a\u7f51\u7ad9\u9879\u76ee\uff0c\u5176\u4ed6\u7684\u5e94\u8be5\u4e5f\u662f\u4e00\u6837\u7684\u539f\u7406<\/span>\uff09<\/span><\/span><\/p>\n

1\u3001\u4e0b\u8f7dnssm\uff0c download<\/a>
<\/span><\/span><\/p>\n

2\u3001\u89e3\u538b\u540e\uff0c\u628anssm.exe\u6587\u4ef6\u590d\u5236\u5230\uff0c\u53d1\u5e03\u5b8c\u9879\u76ee\u7684\u6587\u4ef6\u5939\u91cc\uff08\u5c31\u662f\u653e.exe\u6587\u4ef6\u7684\u90a3\u4e2a\u6587\u4ef6\u5939\uff09<\/span><\/span><\/p>\n

3\u3001\u521b\u5efainstall.bat\u6587\u4ef6\uff08\u540d\u5b57\u968f\u4fbf\u53d6\u90fd\u53ef\u4ee5\uff09\uff0c\u6587\u4ef6\u4e2d\u5185\u5bb9<\/span><\/span><\/p>\n

@ echo off\r\n\r\n@echo \u6dfb\u52a0\u73af\u5883\u53d8\u91cf\r\nset mypath=%~dp0\r\nset path=%mypath%;%path%\r\n\r\n\r\n@echo \u5f00\u59cb\u5b89\u88c5\u3010GDSM\u670d\u52a1\u3011\r\ncall nssm install GDSMService %~dp0GDSMPlateForm.exe\r\n\r\necho wscript.sleep 5000 > delay.vbs \r\ncscript \/\/nologo delay.vbs & del delay.vbs \r\n@echo \u5f00\u59cb\u542f\u52a8\u3010GDSM\u670d\u52a1\u3011\r\ncall nssm start GDSMService\r\n\r\npause<\/pre>\n

4\u3001\u53f3\u952einstall\u6587\u4ef6\uff0c\u521b\u5efa\u5feb\u6377\u65b9\u5f0f\uff08\u5feb\u6377\u65b9\u5f0f\u540d\u5b57\u968f\u4fbf\u53d6\uff09\uff0c\u4fee\u6539\u4e3a\u7ba1\u7406\u5458\u6743\u9650\u6253\u5f00<\/span><\/p>\n

<\/span><\/p>\n<\/p>\n

5\u3001\u53cc\u51fb\u6253\u5f00\u5feb\u6377\u65b9\u5f0f\uff0c\u5c31\u4f1a\u81ea\u52a8\u5b89\u88c5\u670d\u52a1\uff0c\u5e76\u5f00\u542f\u670d\u52a1<\/p>\n

6\u3001\u67e5\u770b\u670d\u52a1<\/p>\n

<\/p>\n<\/p>\n

7\u3001\uff08\u5982\u679c\u9700\u8981\uff09<\/span>\u5220\u9664\u670d\u52a1\uff0c\u5efa\u8bae\u5148\u5173\u95ed\u670d\u52a1\uff0c\u518d\u5220\u9664<\/p>\n

1\uff09\u7ba1\u7406\u5458\u8eab\u4efd\u6253\u5f00cmd\uff0c\u5220\u9664\u547d\u4ee4\uff1asc delete \u670d\u52a1\u540d  \u5982\uff1asc delete GDSMService<\/span><\/p>\n

 <\/p>\n

\u6ce8\u610f\uff1a<\/span><\/p>\n

1\uff09\u5728\u6267\u884cnssm\u547d\u4ee4\u4e4b\u524d\uff0c\u4e00\u5b9a\u8981\u5148\u6dfb\u52a0nssm.exe\u7684\u73af\u5883\u53d8\u91cf\uff0c\u5426\u5219\u4f1a\u51fa\u4e0b\u201c\u627e\u4e0d\u5230nssm\u547d\u4ee4\u201d<\/p>\n

2\uff09\u5b89\u88c5\u670d\u52a1\u548c\u542f\u52a8\u670d\u52a1\u8981\u4f7f\u7528call\uff0c\u4e0d\u80fd\u7528start\u6216\u8005\u4e0d\u5199<\/span>\uff0c\u5426\u5219\u4e5f\u4f1a\u51fa\u73b0\u201c\u627e\u4e0d\u5230nssm\u547d\u4ee4\u201d\uff0c\u539f\u56e0\u662f\u4f7f\u7528start\u6216\u8005\u4e0d\u5199\uff0c\u6dfb\u52a0\u7684\u73af\u5883\u53d8\u91cf\u6ca1\u6709\u7acb\u5373\u751f\u6548<\/p>\n

\uff08\u8fd9\u91cc\u88ab\u5751\u4e86\u5f88\u4e45\uff0c\u4e4b\u524d\u90fd\u662f\u4e0d\u5199\u3010nssm install GDSMService\u3011\uff0c\u7136\u540e\u53d1\u73b0\u73af\u5883\u53d8\u91cf\u4e00\u76f4\u4e0d\u751f\u6548\uff0c\u4e5f\u8bd5\u8fc7\u91cd\u542fexplorer\uff0c\u90fd\u4e0d\u884c<\/span>\uff09<\/p>\n

3\uff09\u6dfb\u52a0\u73af\u5883\u53d8\u91cf\uff08\u4e34\u65f6\u73af\u5883\u53d8\u91cf\uff0c\u7b49\u670d\u52a1\u5b89\u88c5\u5b8c\u6210\uff0c\u73af\u5883\u53d8\u91cf\u4e0d\u5b58\uff09<\/p>\n

nssm install GDSMService C:\\Windows\\Setup\\DSMPlateForm.exe   \u5b8c\u5168\u6ca1\u95ee\u9898<\/pre>\n
\u4f46\u662f\uff0c\u5982\u679c\u60f3\u8981\u4f7f\u7528\u5f53\u524d\u6587\u4ef6\u5939\u7684\u8def\u5f84\u5462\uff1f<\/pre>\n
 \u6b63\u5e38\u5e94\u8be5\u662f\u8fd9\u6837\u7684\uff0c nssm install GDSMService %~dp0GDSMPlateForm.exe  \u7136\u800c\u5c31\u662f\u4e0d\u884c\uff08\u731c\u6d4b\u539f\u56e0\uff1a\u5e94\u8be5\u662fnssm\u6ca1\u6709\u5728\u73af\u5883\u53d8\u91cf\u91cc\u9762\uff0c\u6ca1\u6709\u8d44\u683c\u4f7f\u7528\u7cfb\u7edf\u7684\u53d8\u91cf%~dp0\uff09<\/pre>\n
\u89e3\u51b3\u529e\u6cd5\uff1a\u5148\u6dfb\u52a0nssm.exe\u7684\u73af\u5883\u53d8\u91cf\u5c31\u53ef\u4ee5\u4e86<\/pre>\n


<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"

\u4e4b\u524d\u67e5\u5230\u7684nssm\u5b89\u88c5Windows\u670d\u52a1\u90fd\u662f\u7528 nssm install <servicena […]<\/p>\n","protected":false},"author":1,"featured_media":2033,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-2032","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-23"],"_links":{"self":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/2032"}],"collection":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/comments?post=2032"}],"version-history":[{"count":1,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/2032\/revisions"}],"predecessor-version":[{"id":2035,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/posts\/2032\/revisions\/2035"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/media\/2033"}],"wp:attachment":[{"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/media?parent=2032"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/categories?post=2032"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tra56.com\/wp-json\/wp\/v2\/tags?post=2032"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}