2017-06-21 2 views
0

サービスを手動で起動せずにこのサービスを再起動するにはどうすればよいですか?このサービスを自動的にサービスとして再起動するスクリプトでは、どうすればよいですか?前もって感謝します!WindowsサービスとしてTanukiソフトウェアでwrapper.exeを再起動するコマンドラインを使用して

RunWait, %comspec% /c "net start service_name",, Hide 

サービスを停止する:サービスの開始

C:\Users\Ning>"c:\Program Files (x86)\Tanuki\bin\wrapper.exe" -s "c:\Program Files (x86)\Tanuki\conf\MTG.conf" 
Attempting to start MTG as an NT service. 

Calling StartServiceCtrlDispatcher...please wait. 

StartServiceControlDispatcher failed! 

The -s and --service commands should only be called by the Windows 
ServiceManager to control the Wrapper as a service, and is not 
designed to be run manually by the user. 

For help, type 
c:\Program Files (x86)\Tanuki\bin\wrapper -?} 

答えて

1

が、これは(管理者としてスクリプトを実行)してみてください。

"c:\Program Files (x86)\Tanuki\bin\wrapper.exe" -s "c:\Program Files (x86)\Tanuki\conf\MTG.conf" 

私は、このエラーメッセージが出てい:

RunWait, %comspec% /c "net stop service_name",, Hide 

"service_name"を再起動するサービス名に置き換えます。 表示名ではなく、そのサービスのプロパティに正しいサービス名 が表示されていることを確認してください。

+0

どうすればこのようなことができますか? 「C:¥Program Files(x86)¥Tanuki¥bin¥wrapper.exe」-s「c:¥Program Files(x86)¥Tanuki¥conf¥MTG.conf」 wrapper.exeも使用していますこれはMTG.confの設定を使用します –

+0

上記のコードはAutohotkeyスクリプト用です。 AHKスクリプトでコードをコピーし、コンテキストメニューを使用して管理者として実行してみてください。 – user3419297

+0

ありがとうございました。本当にサービスを開始しましたが、services.mcsまたはService Management Consoleでも「実行中」の状態で確認したかったのです。それはどうですか? –

関連する問題