<?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[.bat startet nicht]]></title><description><![CDATA[<p>hallo erst mal alle mit einander</p>
<p>ich habe einen dialog wo ich einen pfad abfrage und diesen in eine .bat datei schreiben lasse, dies funktioniert auch sehr gut, nur läst sich die .bat deitei nicht starten. die abfrage, das schreiben und das starten passiert mit einem button.</p>
<p>codesampel:</p>
<p>void Waehlen::OnOK()<br />
{<br />
UpdateData(true);<br />
CFile cf;<br />
if (cf.Open( &quot;DEV.bat&quot;, CFile::modeWrite ) )<br />
{<br />
char szData[255];<br />
strcpy((char*)szData, m_pfad);<br />
try<br />
{<br />
cf.SeekToBegin();<br />
cf.Write( szData, strlen( szData ) );<br />
}<br />
catch( CFileException *e )<br />
{<br />
e-&gt;Delete();<br />
}<br />
}<br />
::ShellExecute(m_hWnd,&quot;open&quot;, &quot;DEV.bat&quot;, 0, 0, SW_SHOWNORMAL );<br />
CDialog::OnOK();<br />
}</p>
<p>hoffe mir kann jemand helfen...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/6525/bat-startet-nicht</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 17:02:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/6525.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 07 Jul 2003 09:13:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 09:13:00 GMT]]></title><description><![CDATA[<p>hallo erst mal alle mit einander</p>
<p>ich habe einen dialog wo ich einen pfad abfrage und diesen in eine .bat datei schreiben lasse, dies funktioniert auch sehr gut, nur läst sich die .bat deitei nicht starten. die abfrage, das schreiben und das starten passiert mit einem button.</p>
<p>codesampel:</p>
<p>void Waehlen::OnOK()<br />
{<br />
UpdateData(true);<br />
CFile cf;<br />
if (cf.Open( &quot;DEV.bat&quot;, CFile::modeWrite ) )<br />
{<br />
char szData[255];<br />
strcpy((char*)szData, m_pfad);<br />
try<br />
{<br />
cf.SeekToBegin();<br />
cf.Write( szData, strlen( szData ) );<br />
}<br />
catch( CFileException *e )<br />
{<br />
e-&gt;Delete();<br />
}<br />
}<br />
::ShellExecute(m_hWnd,&quot;open&quot;, &quot;DEV.bat&quot;, 0, 0, SW_SHOWNORMAL );<br />
CDialog::OnOK();<br />
}</p>
<p>hoffe mir kann jemand helfen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31721</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31721</guid><dc:creator><![CDATA[Ghetto-Goffy]]></dc:creator><pubDate>Mon, 07 Jul 2003 09:13:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 09:18:00 GMT]]></title><description><![CDATA[<p>Sollte man die Datei vor dem Ausführen nicht schliessen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31722</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31722</guid><dc:creator><![CDATA[RenéG]]></dc:creator><pubDate>Mon, 07 Jul 2003 09:18:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 09:19:00 GMT]]></title><description><![CDATA[<p>guter gedanke....<br />
....und wie???</p>
<p>[ Dieser Beitrag wurde am 07.07.2003 um 11:20 Uhr von <strong>Ghetto-Goffy</strong> editiert. ]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31723</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31723</guid><dc:creator><![CDATA[Ghetto-Goffy]]></dc:creator><pubDate>Mon, 07 Jul 2003 09:19:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 09:23:00 GMT]]></title><description><![CDATA[<p>wenn ich:</p>
<p>::ShellExecute(m_hWnd,&quot;open&quot;, &quot;DEV_quake.bat&quot;, 0, 0, SW_SHOWNORMAL );<br />
CDialog::OnOK();</p>
<p>auf einen anderen button lege, geht es doch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31725</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31725</guid><dc:creator><![CDATA[Ghetto-Goffy]]></dc:creator><pubDate>Mon, 07 Jul 2003 09:23:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 09:23:00 GMT]]></title><description><![CDATA[<p>Close ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31724</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31724</guid><dc:creator><![CDATA[RenéG]]></dc:creator><pubDate>Mon, 07 Jul 2003 09:23:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 09:28:00 GMT]]></title><description><![CDATA[<p>dann ist ja die datei auch schon geschlossen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31726</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31726</guid><dc:creator><![CDATA[RenéG]]></dc:creator><pubDate>Mon, 07 Jul 2003 09:28:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 09:32:00 GMT]]></title><description><![CDATA[<p>Da stellt sich mal wieder die Frage wie lange eine Locale Variable oder Klasseninstanz gültig ist und ob CFile im Destructor close aufruft.<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/31727</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31727</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Mon, 07 Jul 2003 09:32:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 09:43:00 GMT]]></title><description><![CDATA[<p>im dialog gibt es zwei botton´s, ok und abrechen, und eine eingabefeld. man fühlt das eingabefeld aus und drückt ok, dann werden die informationen aus dem eingabefeld in eine .bat geschrieben und die .bat gestartet. (siehe code am anfang.) die .bat start nicht. leg ich das starten der .bat auf den abbrechenbutton startet die .bat auch. warum???</p>
<p>void Waehlen::OnOK()<br />
{<br />
UpdateData(true);<br />
CFile cf;<br />
if (cf.Open( &quot;DEV_quake.bat&quot;, CFile::modeWrite ) )<br />
{<br />
char szData[255];<br />
strcpy((char*)szData, m_pfad);<br />
try<br />
{<br />
cf.SeekToBegin();<br />
cf.Write( szData, strlen( szData ) );<br />
}<br />
catch( CFileException *e )<br />
{<br />
e-&gt;Delete();<br />
}<br />
}<br />
::ShellExecute(m_hWnd,&quot;open&quot;, &quot;DEV_quake.bat&quot;, 0, 0, SW_SHOWNORMAL );<br />
CDialog::OnOK();</p>
<p>}</p>
<p>void Waehlen::OnCancel()<br />
{<br />
::ShellExecute(m_hWnd,&quot;open&quot;, &quot;DEV_quake.bat&quot;, 0, 0, SW_SHOWNORMAL );<br />
CDialog::OnCancel();<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31728</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31728</guid><dc:creator><![CDATA[Ghetto-Goffy]]></dc:creator><pubDate>Mon, 07 Jul 2003 09:43:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 09:45:00 GMT]]></title><description><![CDATA[<p>Also fangen wir jetzt das Thema wohl nochmal von vorne an?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31729</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31729</guid><dc:creator><![CDATA[RenéG]]></dc:creator><pubDate>Mon, 07 Jul 2003 09:45:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 09:51:00 GMT]]></title><description><![CDATA[<p>Schreib doch einfach in OnOK() vor ShellExecute(...);<br />
cf.Close();</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31730</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31730</guid><dc:creator><![CDATA[Frank ll]]></dc:creator><pubDate>Mon, 07 Jul 2003 09:51:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 09:52:00 GMT]]></title><description><![CDATA[<p>nein, ich wollte nur das ihr einen koplett übersicht habt.<br />
erklär mir bitte &quot;close&quot;, hab im MSDN nachgeguckt aber nicht´s gefunden was mir so auf dei schnelle weiter hilft.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31731</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31731</guid><dc:creator><![CDATA[Ghetto-Goffy]]></dc:creator><pubDate>Mon, 07 Jul 2003 09:52:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 09:59:00 GMT]]></title><description><![CDATA[<p>Was gibt es da zu erklären.<br />
Wenn man eine Datei öffnet muss sie auch wieder geschlossen werden da Windows den Zugriff sperrt (Je nach Parametern bei open)</p>
<p>CFile member close<br />
Beschreibung solltest du in der MSDN finden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31732</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31732</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Mon, 07 Jul 2003 09:59:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 10:11:00 GMT]]></title><description><![CDATA[<p>Ist doch eigentlich ganz einfach:</p>
<p>Mit Open meldest Du beim Betriebssystem an, daß auf Du die Datei &quot;Dev.bat&quot; zugreifen möchtest und mit Close sagst Du daß Du die Operation abgeschlossen hast.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31733</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31733</guid><dc:creator><![CDATA[Frank ll]]></dc:creator><pubDate>Mon, 07 Jul 2003 10:11:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Mon, 07 Jul 2003 10:33:00 GMT]]></title><description><![CDATA[<p>dank euch. funktioniert jetzt alles wie gewollt.<br />
hab cf.close(); vor ::ShellExecute aufgerufen.</p>
<p>aber, warum funktioniert es mit dem abbrechbutton ohne das ich die datei schließe???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31734</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31734</guid><dc:creator><![CDATA[Ghetto-Goffy]]></dc:creator><pubDate>Mon, 07 Jul 2003 10:33:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Tue, 08 Jul 2003 04:47:00 GMT]]></title><description><![CDATA[<p>Ließ dazu bitte mal mein erstes Posting !</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31735</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31735</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Tue, 08 Jul 2003 04:47:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Tue, 08 Jul 2003 23:07:00 GMT]]></title><description><![CDATA[<p>sorry, was soll das für eine antwort sein??? Antwortest du immer mit fragen???</p>
<p>zitat:</p>
<p>Da stellt sich mal wieder die Frage wie lange eine Locale Variable oder Klasseninstanz gültig ist und ob CFile im Destructor close aufruft.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31736</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31736</guid><dc:creator><![CDATA[Ghetto-Goffy]]></dc:creator><pubDate>Tue, 08 Jul 2003 23:07:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Wed, 09 Jul 2003 04:41:00 GMT]]></title><description><![CDATA[<p>OH MANO.</p>
<p>Wenn du eine Locale Instanz von CFile erstellst ist diese nach dem verlassen der Funktion nicht mehr existent.<br />
Im Destuctor von CFile wir das File automatisch geschlossen.</p>
<p>Das es nun geschlossen ist kannst du mit einer neuen Funktion wieder auf das File zugreifen.</p>
<p>Ein paar Grundlagen würde ich dir schon empfehlen zum wissen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31737</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31737</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Wed, 09 Jul 2003 04:41:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Wed, 09 Jul 2003 07:17:00 GMT]]></title><description><![CDATA[<p>dank dir, wieder was gelernt.</p>
<p>sorry, das ich noch nicht der &quot;c-gott&quot; bin wie du, aber des wegen komme ich doch hier ins forum. ich weiß wenn ich hier poste bekommme ich schnelle und verständliche hilfe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31738</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31738</guid><dc:creator><![CDATA[Ghetto-Goffy]]></dc:creator><pubDate>Wed, 09 Jul 2003 07:17:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Wed, 09 Jul 2003 07:35:00 GMT]]></title><description><![CDATA[<p>Ich bin nicht der c-Gott!</p>
<p>Bevor man aber komplexe Sachen macht sollte man sich vorher die Grundlagen ansehen.<br />
Dies sind nicht komplexe oder erweiterte Grundlagen sondern unbedingt notwendige.<br />
Wie z.B wie definiere ich eine Klasse in einer Headerdatei.<br />
Dies ist auch nichts gegen dich persönlich sondern ein Ratschlag.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31739</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31739</guid><dc:creator><![CDATA[Unix-Tom]]></dc:creator><pubDate>Wed, 09 Jul 2003 07:35:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Wed, 09 Jul 2003 07:51:00 GMT]]></title><description><![CDATA[<p>ich denke schon das ich die grundlagen von c++ kenne, wußte nur nicht das eine locale instanz einer klasse beim verlassen der funktion gelöscht werden.</p>
<p>so denke wir sollten das thema an der stelle beenden.<br />
dank noch ma.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31740</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31740</guid><dc:creator><![CDATA[Ghetto-Goffy]]></dc:creator><pubDate>Wed, 09 Jul 2003 07:51:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Wed, 09 Jul 2003 08:14:00 GMT]]></title><description><![CDATA[<blockquote>
<p>ich denke schon das ich die grundlagen von c++ kenne</p>
</blockquote>
<blockquote>
<pre><code class="language-cpp">char szData[255];
strcpy((char*)szData, m_pfad);
try
{
  cf.SeekToBegin();
  cf.Write( szData, strlen( szData ) );
}
</code></pre>
</blockquote>
<p>Sorry, wenn wir dich aufgrund des obigen Codes zu den absoluten Anfängern zählen, aber wer sonst würde den Inhalt einer 1l-Flasche in einen Messbecher schütten, um rauszufinden, wieviel in die Flasche passt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31741</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31741</guid><dc:creator><![CDATA[RenéG]]></dc:creator><pubDate>Wed, 09 Jul 2003 08:14:00 GMT</pubDate></item><item><title><![CDATA[Reply to .bat startet nicht on Wed, 09 Jul 2003 09:49:00 GMT]]></title><description><![CDATA[<p>ich kann dir leider nicht folgen:</p>
<p>char szData[255]; //große von szData festlegen<br />
strcpy((char*)szData, m_pfad); //CString m_pfad nach szData kopieren<br />
try //szData in die .bat schreiben<br />
{<br />
cf.SeekToBegin();<br />
cf.Write( szData, strlen( szData ) );<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/31742</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/31742</guid><dc:creator><![CDATA[Ghetto-Goffy]]></dc:creator><pubDate>Wed, 09 Jul 2003 09:49:00 GMT</pubDate></item></channel></rss>