{"id":288406,"date":"2018-08-23T13:05:02","date_gmt":"2018-08-23T09:05:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=288406"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=288406","title":{"rendered":"\u041f\u0438\u043b\u0438\u043c \u0441\u0432\u043e\u044e \u0441\u043b\u0443\u0436\u0431\u0443 Windows \u2013 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u00ab\u043d\u0435 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432\u00bb"},"content":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/company\/pc-administrator\/blog\/421019\/\" class=\"post__text post__text-html js-mediator-article\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/j3\/j5\/7b\/j3j57big8bze9751j7_frrcjc7q.jpeg\"><\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u0436\u0434\u044b \u0432\u044b \u0437\u0430\u0434\u0443\u043c\u0430\u0435\u0442\u0435\u0441\u044c, \u043a\u0430\u043a \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 Windows-\u0441\u043b\u0443\u0436\u0431\u0443. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u0443\u0436 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u2013 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0410 \u0440\u0430\u0437 \u0435\u0441\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u0442\u043e \u0435\u0441\u0442\u044c \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u0438 \u043c\u0438\u043b\u044b\u0435 \u0441\u0435\u0440\u0434\u0446\u0443 \u043a\u043e\u0441\u0442\u044b\u043b\u0438\u043a\u0438 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0442\u0435\u043c, \u043a\u0442\u043e, \u043a\u0430\u043a \u0438 \u044f \u2014 \u00ab\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043d\u0435 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439\u00bb.<a name=\"habracut\"><\/a><\/p>\n<p>  <\/p>\n<h1 id=\"zachem-nuzhna-sluzhba-esli-est-naznachennye-zadaniya\">\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u043d\u0430 \u0441\u043b\u0443\u0436\u0431\u0430, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f<\/h1>\n<p>  <\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0441\u043b\u0443\u0436\u0431\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u041f\u041a \u0438 \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Windows. \u0410 \u0435\u0449\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u043e\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 TCP \u0438\u043b\u0438 Web \u0441\u0435\u0440\u0432\u0435\u0440\u0430. <\/p>\n<p>  <\/p>\n<p>\u041b\u0438\u0447\u043d\u043e \u043c\u043d\u0435 \u0437\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u043f\u044f\u0442\u044c \u043b\u0435\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043b\u0443\u0436\u0431\u0443 \u0442\u0440\u0438 \u0441 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u043e\u0439 \u0440\u0430\u0437\u0430:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 <strong>fail2ban \u0434\u043b\u044f Windows 2003.<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 \u043b\u043e\u0433\u0430\u043c\u0438 FileZilla \u0438 Apache, \u0430 \u043f\u0440\u0438 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u043d\u0438\u0438 \u043d\u0430 \u0431\u0440\u0443\u0442\u0444\u043e\u0440\u0441 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043b IP \u0448\u0442\u0430\u0442\u043d\u044b\u043c\u0438 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430\u043c\u0438 Windows \u2014 ipsec.<\/li>\n<li>\u0410\u043d\u0430\u043b\u043e\u0433 \u0442\u0435\u043b\u043d\u0435\u0442-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0434\u043b\u044f \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Windows. \u041f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u043f\u043e\u0434 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c Windows 7 Home. \u041f\u043e \u0441\u0443\u0442\u0438, \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0432 \u0441\u043b\u0443\u0436\u0431\u044b.<\/li>\n<li>\u041c\u0443\u0437\u044b\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u0442\u043e\u0440\u0433\u043e\u0432\u043e\u0433\u043e \u0437\u0430\u043b\u0430 \u043f\u043e\u0434 Windows. \u0417\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u0422\u0417 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <strong><a href=\"https:\/\/www.musicpd.org\">mpd<\/a><\/strong> \u0438 \u043f\u0430\u0447\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432, \u043d\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u2014 \u0435\u0441\u043b\u0438 \u0443\u0436 \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u0442\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u0438 \u043d\u0435 \u00ab\u0441\u0432\u0430\u044f\u0442\u044c\u00bb \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u0442\u0435\u043b\u044c \u0441\u0430\u043c\u043e\u043c\u0443. \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0432\u0437\u044f\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"http:\/\/www.un4seen.com\">BASS.dll<\/a>.<\/li>\n<li>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b\u0431\u0438\u0440\u0430\u043b\u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u043e\u0434 Windows, \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0431\u044b\u043b <strong><a href=\"http:\/\/www.rejetto.com\/hfs\/\">HFS<\/a><\/strong>. \u0421\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u043d \u043d\u0435 \u043c\u043e\u0436\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u00ab\u0437\u0430\u043f\u0438\u0445\u0438\u0432\u0430\u0442\u044c\u00bb \u0435\u0433\u043e \u0432 \u0441\u043b\u0443\u0436\u0431\u0443. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c, \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u00ab\u0442\u0435\u043c\u0443\u00bb <a href=\"https:\/\/oupala.github.io\/apaxy\/\">Apaxy<\/a> \u043d\u0430 web-\u0441\u0435\u0440\u0432\u0435\u0440\u0435 Apache.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043b\u0443\u0436\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0437\u0440\u043e\u0441\u043b\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u0440\u043e\u0434\u0435 C. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u0442\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0441 Visual Studio, \u0442\u043e \u0432\u043e\u0437\u044c\u043c\u0438\u0442\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0440\u043e\u0434\u0435 <a href=\"http:\/\/www.firedaemon.com\/products\">FireDaemon Pro<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/www.coretechnologies.com\/products\/AlwaysUp\/\">AlwaysUp<\/a>, \u043d\u043e \u043c\u044b \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<h1 id=\"sposob-pervyy-ot-microsoft\">\u0421\u043f\u043e\u0441\u043e\u0431 \u043f\u0435\u0440\u0432\u044b\u0439. \u041e\u0442 Microsoft<\/h1>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u0443\u0436\u0435 \u043d\u0435\u043c\u043e\u043b\u043e\u0434\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432: \u0443\u0442\u0438\u043b\u0438\u0442\u044b <strong>instsrv.exe <\/strong>\u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 <strong>srvany.exe<\/strong> \u2014 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043b\u044e\u0431\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 PowerShell \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u043e\u0434\u0443\u043b\u044f <a href=\"https:\/\/github.com\/powershell\/Polaris\">Polaris<\/a>. \u0421\u043a\u0440\u0438\u043f\u0442 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442:<\/p>\n<p>  <\/p>\n<pre><code>New-PolarisGetRoute -Path '\/helloworld' -Scriptblock {     $Response.Send('Hello World!') }  Start-Polaris -Port 8080  while($true) {     Start-Sleep -Milliseconds 10 }<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/im\/br\/xz\/imbrxzpsqml1osyityi0k1nwe1w.jpeg\"><br \/>  <em>\u0420\u0430\u0431\u043e\u0442\u0430 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u00ab\u0441\u0435\u0440\u0432\u0435\u0440\u0430\u00bb.<\/em><\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u0441\u043b\u0443\u0436\u0431\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0430\u0447\u0430\u0435\u043c <a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=17657\">Windows Resource Kit Tools<\/a>, \u0433\u0434\u0435 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0448\u0438 \u0443\u0442\u0438\u043b\u0438\u0442\u044b. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043f\u0443\u0441\u0442\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<p>  <\/p>\n<pre><code>instsrv WebServ C:\\temp\\rktools\\srvany.exe <\/code><\/pre>\n<p>  <\/p>\n<p>\u0413\u0434\u0435 WebServ \u2014 \u0438\u043c\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430. \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u043e\u0441\u043d\u0430\u0441\u0442\u043a\u0443 <strong>services.msc<\/strong> \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u0443\u0436\u0431\u0430, \u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441 \u0440\u0430\u0431\u043e\u0447\u0438\u043c \u0441\u0442\u043e\u043b\u043e\u043c. <\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043c\u0430\u0433\u0438\u0438 \u0440\u0435\u0435\u0441\u0442\u0440\u0430. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u043b\u0443\u0436\u0431\u044b \u0435\u0441\u0442\u044c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0440\u0435\u0435\u0441\u0442\u0440\u0430 <strong>HKLM\\SYSTEM\\CurrentControlSet\\Services\\WebServ<\/strong>. \u0412 \u043d\u0435\u043c \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b <strong>Parameters <\/strong>\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u043c \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <strong>Application<\/strong>, \u0443\u043a\u0430\u0437\u0430\u0432 \u0432 \u043d\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 PowerShell \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code>C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Bypass -NoProfile -File C:\\temp\\Polaris\\server.ps1 <\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2c\/9a\/zw\/2c9azwf_tlvz6cs2ez4jlw7pl58.jpeg\"><br \/>  <em>\u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u0441\u043b\u0443\u0436\u0431\u0430.<\/em><\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438 \u0440\u0430\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4j\/qh\/kd\/4jqhkdbgssb6gv8el-qpnfn4wea.jpeg\"><br \/>  <em>\u0420\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0430\u044f \u0441\u043b\u0443\u0436\u0431\u0430.<\/em><\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u0443 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0435\u0441\u0442\u044c \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0423\u0442\u0438\u043b\u0438\u0442\u044b \u0441\u0442\u0430\u0440\u044b\u0435, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u044b \u0434\u043e \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0435\u043d\u0438\u044f PowerShell, UAC \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0432\u0435\u0449\u0435\u0439.<\/li>\n<li><strong>Srvany<\/strong> \u043d\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u043e \u0432\u044b\u043f\u0430\u0434\u0435\u0442 \u0432 \u043e\u0448\u0438\u0431\u043a\u0443, \u0441\u043b\u0443\u0436\u0431\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442 \u0441\u0432\u043e\u0435 \u0434\u0435\u043b\u043e \u043a\u0430\u043a \u043d\u0438 \u0432 \u0447\u0435\u043c \u043d\u0435 \u0431\u044b\u0432\u0430\u043b\u043e.<\/li>\n<li>\u041f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0434\u043e\u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0438 \u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435. \u0412\u044b \u0436\u0435 \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0447\u0442\u043e \u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e?<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043c\u0435\u0442\u043e\u0434\u0443, \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e \u043b\u0438\u0448\u0435\u043d\u043d\u043e\u043c\u0443 \u044d\u0442\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<p>  <\/p>\n<h1 id=\"sposob-vtoroy-pochti-vzroslyy\">\u0421\u043f\u043e\u0441\u043e\u0431 \u0432\u0442\u043e\u0440\u043e\u0439, \u043f\u043e\u0447\u0442\u0438 \u0432\u0437\u0440\u043e\u0441\u043b\u044b\u0439<\/h1>\n<p>  <\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/nssm.cc\">NSSM<\/a> \u2014 <strong>Non-Sucking Service Manager<\/strong>, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043a\u0430\u043a <em>\u043d\u0435-\u043f\u043b\u043e\u0445\u043e\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0441\u043b\u0443\u0436\u0431<\/em>. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439, \u043e\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u043c, \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u043d\u0430 \u0441\u0430\u0439\u0442\u0435. \u041f\u043e\u043c\u0438\u043c\u043e \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430, \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u043a\u0435\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 <a href=\"http:\/\/chocolatey.org\/packages\/NSSM\">Chocolately<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u043c\u043e\u0436\u043d\u043e \u0438\u0437 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0432\u043e\u043e\u0440\u0443\u0436\u0438\u0432\u0448\u0438\u0441\u044c <a href=\"https:\/\/nssm.cc\/usage\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439<\/a> \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u041d\u043e \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f PowerShell. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u043c, \u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f.<\/p>\n<p>  <\/p>\n<pre><code>$nssm = (Get-Command .\/nssm).Source $serviceName = 'WebServ' $powershell = (Get-Command powershell).Source $scriptPath = 'C:\\temp\\Polaris\\server.ps1' $arguments = '-ExecutionPolicy Bypass -NoProfile -File \"{0}\"' -f $scriptPath &amp; $nssm install $serviceName $powershell $arguments &amp; $nssm status $serviceName Start-Service $serviceName Get-Service $serviceName<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nn\/gf\/xz\/nngfxzjxsimbi2srebmcwjzioie.jpeg\"><br \/>  <em>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 PowerShell.<\/em><\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043b\u0443\u0436\u0431\u044b \u043d\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u043e\u043c, \u0430 \u0442\u043e\u0436\u0435 \u0447\u0435\u0440\u0435\u0437 PowerShell \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <strong>Invoke-RestMethod.<\/strong><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/b-\/wg\/17\/b-wg17nhhlesw6xon8sdv9c0hks.png\"><br \/>  <em>\u0418 \u0432\u043f\u0440\u0430\u0432\u0434\u0443 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/em><\/p>\n<p>  <\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 <strong>srvany<\/strong>, \u044d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u0435, \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c <strong>stdin<\/strong> \u0438 <strong>stdout<\/strong> \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c GUI \u0438 \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0447\u0435\u0440\u0435\u0437 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. <\/p>\n<p>  <\/p>\n<p>GUI \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<p>  <\/p>\n<pre><code>nssm.exe install ServiceName<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ji\/rg\/6i\/jirg6iwexgpn_3zun4ich0zgepo.jpeg\"><br \/>  <em>\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044f\u0434\u0435\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430.<\/em><\/p>\n<p>  <\/p>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043a\u0443\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0443 <strong>srvany<\/strong> \u0438 \u0440\u044f\u0434\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 <a href=\"https:\/\/alternativeto.net\/software\/nssm--the-non-sucking-service-manager\/\">\u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432<\/a>. \u0418\u0437 \u043c\u0438\u043d\u0443\u0441\u043e\u0432 \u0431\u0440\u043e\u0441\u0430\u0435\u0442\u0441\u044f \u0432 \u0433\u043b\u0430\u0437\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0432\u0441\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c. <\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043b\u0438\u0446\u043e \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0430 \u00ab\u0436\u0435\u0441\u0442\u0438\u00bb. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0435\u0440\u0435\u0439\u0434\u0443 \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0445\u0430\u0440\u0434\u043a\u043e\u0440\u043d\u043e\u043c\u0443 \u043c\u0435\u0442\u043e\u0434\u0443 \u0438\u0437 \u0432\u0441\u0435\u0445 \u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  <\/p>\n<h1 id=\"sposob-tretiy-autoit\">\u0421\u043f\u043e\u0441\u043e\u0431 \u0442\u0440\u0435\u0442\u0438\u0439. AutoIT<\/h1>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044f \u0434\u0430\u0432\u043d\u0438\u0439 \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430, \u0442\u043e \u043d\u0435 \u0441\u043c\u043e\u0433 \u043f\u0440\u043e\u0439\u0442\u0438 \u043c\u0438\u043c\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/www.autoitscript.com\/forum\/topic\/80201-_service_udf-v4-build-your-own-service-with-autoit-code\/\">_Services_UDF v4<\/a>. \u041e\u043d\u0430 \u0441\u043d\u0430\u0431\u0436\u0435\u043d\u0430 \u0431\u043e\u0433\u0430\u0442\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u043e\u043b\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041b\u0438\u0441\u0442\u0438\u043d\u0433 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u00ab\u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u00bb \u0432 \u043d\u0435\u0435 \u043d\u0430\u0448 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441:<\/p>\n<p>  <\/p>\n<pre><code>#NoTrayIcon #RequireAdmin #Region #AutoIt3Wrapper_Version=Beta #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y #EndRegion  Dim $MainLog = @ScriptDir &amp; \"\\test_service.log\"  #include &lt;services.au3&gt; #include &lt;WindowsConstants.au3&gt;  $sServiceName=\"WebServ\"  If $cmdline[0] &gt; 0 Then     Switch $cmdline[1]         Case \"install\", \"-i\", \"\/i\"             InstallService()         Case \"remove\", \"-u\", \"\/u\", \"uninstall\"             RemoveService()         Case Else             ConsoleWrite(\" - - - Help - - - \" &amp; @CRLF)             ConsoleWrite(\"params : \" &amp; @CRLF)             ConsoleWrite(\" -i : install service\" &amp; @CRLF)             ConsoleWrite(\" -u : remove service\" &amp; @CRLF)             ConsoleWrite(\" - - - - - - - - \" &amp; @CRLF)             Exit     EndSwitch Else     _Service_init($sServiceName)     Exit EndIf  Func _main($iArg, $sArgs) If Not _Service_ReportStatus($SERVICE_RUNNING, $NO_ERROR, 0) Then     _Service_ReportStatus($SERVICE_STOPPED, _WinAPI_GetLastError(), 0)     Exit EndIf  $bServiceRunning = True $PID=Run(\"C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -ExecutionPolicy Bypass -NoProfile -File C:\\temp\\Polaris\\server.ps1\")  While $bServiceRunning _sleep(1000) WEnd ProcessClose($PID)  _Service_ReportStatus($SERVICE_STOP_PENDING, $NO_ERROR, 1000) DllCallbackFree($tServiceMain) DllCallbackFree($tServiceCtrl) _Service_ReportStatus($SERVICE_STOPPED, $NO_ERROR, 0) DllClose($hAdvapi32_DLL) DllClose($hKernel32_DLL) EndFunc  Func _Sleep($delay) Local $result = DllCall($hKernel32_DLL, \"none\", \"Sleep\", \"dword\", $delay) EndFunc  Func InstallService()     #RequireAdmin     Local $bDebug = True     If $cmdline[0] &gt; 1 Then         $sServiceName = $cmdline[2]     EndIf     If $bDebug Then ConsoleWrite(\"InstallService(\"&amp;$sServiceName &amp;\"): Installing service, please wait\")     _Service_Create($sServiceName, $sServiceName, $SERVICE_WIN32_OWN_PROCESS, $SERVICE_AUTO_START, $SERVICE_ERROR_SEVERE, '\"' &amp; @ScriptFullPath &amp; '\"');,\"\",False,\"\",\"NT AUTHORITY\\NetworkService\")     If @error Then         Msgbox(\"\",\"\",\"InstallService(): Problem installing service, Error number is \" &amp; @error &amp; @CRLF &amp; \" message : \" &amp; _WinAPI_GetLastErrorMessage())     Else         If $bDebug Then ConsoleWrite(\"InstallService(): Installation of service successful\")     EndIf     Exit EndFunc  Func RemoveService()     _Service_Stop($sServiceName)     _Service_Delete($sServiceName)     If Not @error Then     EndIf     Exit EndFunc  Func _exit()     _Service_ReportStatus($SERVICE_STOPPED, $NO_ERROR, 0); EndFunc  Func StopTimer()     _Service_ReportStatus($SERVICE_STOP_PENDING, $NO_ERROR, $iServiceCounter)     $iServiceCounter += -100 EndFunc  Func _Stopping()     _Service_ReportStatus($SERVICE_STOP_PENDING, $NO_ERROR, 3000)  EndFunc<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u043d \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <strong>$bServiceRunning = True<\/strong> \u0438 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0446\u0438\u043a\u043b. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u0440\u0435\u0440\u0432\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u0443\u0436\u0431\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0441\u0438\u0433\u043d\u0430\u043b \u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u2014 \u0431\u0443\u0434\u044c \u0442\u043e \u0432\u044b\u0445\u043e\u0434 \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u043b\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u0440\u0443\u0447\u043d\u0443\u044e.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043d\u0435\u0448\u043d\u0435\u0439 (powershell.exe), \u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437 \u0446\u0438\u043a\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u0435\u0435 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <strong>ProcessClose<\/strong>.<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 <strong>.exe<\/strong>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043b\u0443\u0436\u0431\u0443, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 exe \u0441 \u043a\u043b\u044e\u0447\u043e\u043c <strong>-i.<\/strong><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/wl\/xp\/ph\/wlxpphvp20lakbyd2wii7ssytle.jpeg\"><br \/>  <em>\u041e\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/em><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0443\u0434\u043e\u0431\u043d\u044b\u0439, \u0438 \u0432\u0441\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u0431\u0443\u0434\u044c \u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0441\u0431\u043e\u0435 \u0438\u043b\u0438 \u0440\u043e\u0442\u0430\u0446\u0438\u044f \u043b\u043e\u0433\u043e\u0432. \u041d\u043e \u0437\u0430\u0442\u043e \u043e\u043d \u0434\u0430\u0435\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u043c. \u0414\u0430 \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u0438\u0442\u043e\u0433\u0435 \u043c\u043e\u0436\u043d\u043e \u043a\u0443\u0434\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u2014 \u043e\u0442 <a href=\"https:\/\/habr.com\/company\/pc-administrator\/blog\/353652\/\">\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f<\/a> \u0432 Telegram \u043e \u0441\u0431\u043e\u0435 \u0441\u043b\u0443\u0436\u0431\u044b \u0434\u043e IPC-\u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430\u043c\u0438. \u0418 \u0432\u0434\u043e\u0431\u0430\u0432\u043e\u043a \u2014 \u043d\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432\u043e\u043c \u044f\u0437\u044b\u043a\u0435, \u0431\u0435\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0438 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f Visual Studio.<\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0438\u0442\u0435, \u0430 \u0432\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0441\u043b\u0443\u0436\u0431\u044b?<\/p>\n<\/div>\n<p>        <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/post\/421019\/\"> https:\/\/habr.com\/post\/421019\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div data-io-article-url=\"https:\/\/habr.com\/company\/pc-administrator\/blog\/421019\/\" class=\"post__text post__text-html js-mediator-article\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/j3\/j5\/7b\/j3j57big8bze9751j7_frrcjc7q.jpeg\"><\/p>\n<p>  <\/p>\n<p>\u041e\u0434\u043d\u0430\u0436\u0434\u044b \u0432\u044b \u0437\u0430\u0434\u0443\u043c\u0430\u0435\u0442\u0435\u0441\u044c, \u043a\u0430\u043a \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 Windows-\u0441\u043b\u0443\u0436\u0431\u0443. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u0443\u0436 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u2013 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434 \u043e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u0410 \u0440\u0430\u0437 \u0435\u0441\u0442\u044c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u0442\u043e \u0435\u0441\u0442\u044c \u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u0438 \u043c\u0438\u043b\u044b\u0435 \u0441\u0435\u0440\u0434\u0446\u0443 \u043a\u043e\u0441\u0442\u044b\u043b\u0438\u043a\u0438 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0442\u0435\u043c, \u043a\u0442\u043e, \u043a\u0430\u043a \u0438 \u044f \u2014 \u00ab\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043d\u0435 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439\u00bb.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-288406","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288406"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/288406\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}