<?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[Registry Einträge]]></title><description><![CDATA[<p>Ich möchte ein Programm schreibe, dass sich in die Registry einträgt. Es sieht volgendermaße aus:</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;cstdlib&gt;
#include &lt;iostream&gt;

using namespace std;

int main()
{
    cout&lt;&lt;&quot;Ich schreibe mich jetzt in deinen Autostart&quot;;;
    system(&quot;reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v test /d test.exe&quot;);
}
</code></pre>
<p>doch wenn ich es ausführe steht da immer ungültiger Pfad. Als .bat datei funktioniert es aber. Was mache ich falsch?</p>
<p>danke schonmal</p>
<p>CPing</p>
<p>/edit:<br />
ich weiß, dass ich dieDatei verschieben müsste. Also ind den windows Prdner. Doch dies habe ich im code mal weggelassen. Der genaue Fehler Lautet:<br />
&quot;Ungültiger Schlüsselname&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/223141/registry-einträge</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Apr 2026 07:19:16 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/223141.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 22 Sep 2008 20:33:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Registry Einträge on Mon, 22 Sep 2008 20:36:36 GMT]]></title><description><![CDATA[<p>Ich möchte ein Programm schreibe, dass sich in die Registry einträgt. Es sieht volgendermaße aus:</p>
<pre><code>#include &lt;windows.h&gt;
#include &lt;cstdlib&gt;
#include &lt;iostream&gt;

using namespace std;

int main()
{
    cout&lt;&lt;&quot;Ich schreibe mich jetzt in deinen Autostart&quot;;;
    system(&quot;reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v test /d test.exe&quot;);
}
</code></pre>
<p>doch wenn ich es ausführe steht da immer ungültiger Pfad. Als .bat datei funktioniert es aber. Was mache ich falsch?</p>
<p>danke schonmal</p>
<p>CPing</p>
<p>/edit:<br />
ich weiß, dass ich dieDatei verschieben müsste. Also ind den windows Prdner. Doch dies habe ich im code mal weggelassen. Der genaue Fehler Lautet:<br />
&quot;Ungültiger Schlüsselname&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1586200</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1586200</guid><dc:creator><![CDATA[CPing]]></dc:creator><pubDate>Mon, 22 Sep 2008 20:36:36 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Einträge on Mon, 22 Sep 2008 20:37:02 GMT]]></title><description><![CDATA[<p>Dein Fehler ist, dass du <code>system</code> verwendest. Verwende lieber die entsprechenden WinAPI Funktionen dazu:<br />
<a href="http://msdn.microsoft.com/en-us/library/ms724875(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms724875(VS.85).aspx</a></p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1586202</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1586202</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Mon, 22 Sep 2008 20:37:02 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Einträge on Mon, 22 Sep 2008 20:45:09 GMT]]></title><description><![CDATA[<p>Naja schau Mal, du gibst ihm ein Pfad an der nicht existiert. Warum fragst du dich ? Weil du in Wirklichkeit das hier schreibst :</p>
<p>red add HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun ...</p>
<p>Alles was in C++ ein &quot; \ &quot; davor hat, ist eine Escape-Sequenz, d.h. du müsstest das folgt schreiben :</p>
<pre><code>system(&quot;reg add HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run /v test /d test.exe&quot;);
</code></pre>
<p>Das könnteste z.B. auch gerne mal mit cout testen. Schau dir mal an was dein Programm macht, bzw. dein Compiler vllt. meckert wenn du folgendes machst.</p>
<pre><code>int main()
{
std::cout &lt;&lt; &quot;Hal\\lo&quot; &lt;&lt; std::endl;
std::cout &lt;&lt; &quot;Hal\lo&quot;;
}
</code></pre>
<p>Glaube hiermit ist deine Frage wenn ich mich nicht irre oder was falsch verstanden hab beantwortet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1586203</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1586203</guid><dc:creator><![CDATA[freaky]]></dc:creator><pubDate>Mon, 22 Sep 2008 20:45:09 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Einträge on Mon, 22 Sep 2008 20:47:33 GMT]]></title><description><![CDATA[<p>Vielen Dank Freaky und auch dir Dravere.<br />
Kann mann hier User irgendwie bewerten oder so? xD</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1586205</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1586205</guid><dc:creator><![CDATA[CPing]]></dc:creator><pubDate>Mon, 22 Sep 2008 20:47:33 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Einträge on Mon, 22 Sep 2008 21:14:12 GMT]]></title><description><![CDATA[<p>CPing schrieb:</p>
<blockquote>
<p>Kann mann hier User irgendwie bewerten oder so? xD</p>
</blockquote>
<p>Nein, wäre auch wenig sinnvoll (einige mögen manche Ratschläge nicht, auch wenn sie sinnvoll sind).</p>
<p>Aber noch 2 Bitten für die Zukunft:<br />
1. Wenn es um Windowsspezifisches geht, poste lieber im WinAPI-Unterforum (zumindestens wenn du windows.h einsetzt - Sprich die Windows API).<br />
2. Benutze bitte die cpp-Tags (statt den code-Tags) um C/C++ Code auch farblich hervorzuheben. Ist lesbarer.</p>
<p>cu André</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1586210</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1586210</guid><dc:creator><![CDATA[asc]]></dc:creator><pubDate>Mon, 22 Sep 2008 21:14:12 GMT</pubDate></item><item><title><![CDATA[Reply to Registry Einträge on Thu, 25 Sep 2008 11:16:31 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/1587812</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1587812</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Thu, 25 Sep 2008 11:16:31 GMT</pubDate></item></channel></rss>