<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Programm welches als Dienst (service) läuft restarten]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe hier ein Programm geschrieben, welches unter Windows als system dienst im Hintergrund läuft. Nun ist es ab und an notwendig dieses Programm einfach neu zu starten. Ich hab es schon mit createprocess(..) versucht selbst zu starten und die alte Instanz mit exitprocess() zu schliessen. Aber leider schlägt CreateProcess immer fehl. Läuft das Programm als normale Konsolen Applikation funktioniert alles einwandfrei. Ich vermute das es irgendwie mit den rechten zusammenhängt die so ein Dienst nur hat.</p>
<p>Kennt Ihr vielleicht einen Weg den Dienst aus dem Programm heraus zu starten?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/179703/programm-welches-als-dienst-service-läuft-restarten</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Jul 2026 13:32:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/179703.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 Apr 2007 15:47:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Programm welches als Dienst (service) läuft restarten on Tue, 24 Apr 2007 15:47:16 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe hier ein Programm geschrieben, welches unter Windows als system dienst im Hintergrund läuft. Nun ist es ab und an notwendig dieses Programm einfach neu zu starten. Ich hab es schon mit createprocess(..) versucht selbst zu starten und die alte Instanz mit exitprocess() zu schliessen. Aber leider schlägt CreateProcess immer fehl. Läuft das Programm als normale Konsolen Applikation funktioniert alles einwandfrei. Ich vermute das es irgendwie mit den rechten zusammenhängt die so ein Dienst nur hat.</p>
<p>Kennt Ihr vielleicht einen Weg den Dienst aus dem Programm heraus zu starten?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1272578</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1272578</guid><dc:creator><![CDATA[buggybear]]></dc:creator><pubDate>Tue, 24 Apr 2007 15:47:16 GMT</pubDate></item><item><title><![CDATA[Reply to Programm welches als Dienst (service) läuft restarten on Tue, 24 Apr 2007 23:33:04 GMT]]></title><description><![CDATA[<p>Hallo !</p>
<p>Du kannst den system() Befehl benutzen.</p>
<p>system(&quot;sc start 'dein_service'&quot;);</p>
<p>Gruß,<br />
p.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1272875</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1272875</guid><dc:creator><![CDATA[proggingmania]]></dc:creator><pubDate>Tue, 24 Apr 2007 23:33:04 GMT</pubDate></item><item><title><![CDATA[Reply to Programm welches als Dienst (service) läuft restarten on Wed, 25 Apr 2007 06:52:01 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-403.html" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1272924</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1272924</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Wed, 25 Apr 2007 06:52:01 GMT</pubDate></item><item><title><![CDATA[Reply to Programm welches als Dienst (service) läuft restarten on Wed, 25 Apr 2007 07:01:27 GMT]]></title><description><![CDATA[<p>Schau Dir mal den Code hier an<br />
<a href="http://www.naughter.com/serv.html" rel="nofollow">http://www.naughter.com/serv.html</a><br />
speziell die Klasse CNTServiceControlManager und CNTScmService!</p>
<p>Dir Reihenfolge ist in etwas:<br />
OpenSCManager<br />
OpenService<br />
StartService</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1272928</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1272928</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Wed, 25 Apr 2007 07:01:27 GMT</pubDate></item><item><title><![CDATA[Reply to Programm welches als Dienst (service) läuft restarten on Wed, 25 Apr 2007 22:43:45 GMT]]></title><description><![CDATA[<pre><code>rem restart.bat
net stop myservice
net start myservice
</code></pre>
<p>Kannste mit &quot;at&quot; oder &quot;scheduled tasks&quot; ganz einfach automatisieren. (Bei &quot;scheduled tasks&quot; nimm das &quot;NT AUTHORITY\SYSTEM&quot; Konto, sonst hagelt es u.U. Probleme.)<br />
Oder *muss* es aus einem eigenen Programm raus sein? In dem Fall könntest du das einfach über &quot;CreateProcess( ... &quot;cmd.exe /c restart.bat&quot; ...) rausstarten wenn dir das nicht &quot;zu billig&quot; ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1273607</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1273607</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Wed, 25 Apr 2007 22:43:45 GMT</pubDate></item></channel></rss>