<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>the XCEPtion proves the rule &#187; Fenster</title>
	<atom:link href="http://www.xcep.net/blog/tag/fenster/feed" rel="self" type="application/rss+xml" />
	<link>http://www.xcep.net/blog</link>
	<description></description>
	<lastBuildDate>Mon, 06 Feb 2012 09:51:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>[HOWTO] Das Fenster einer ausgeführten Batch-Datei verstecken (Cronjob)</title>
		<link>http://www.xcep.net/blog/2009/05/24/howto-das-fenster-einer-ausgefuhrten-batch-datei-verstecken-cronjob/index.php</link>
		<comments>http://www.xcep.net/blog/2009/05/24/howto-das-fenster-einer-ausgefuhrten-batch-datei-verstecken-cronjob/index.php#comments</comments>
		<pubDate>Sun, 24 May 2009 13:13:41 +0000</pubDate>
		<dc:creator>tXptr</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Batch]]></category>
		<category><![CDATA[Cronjob]]></category>
		<category><![CDATA[Fenster]]></category>
		<category><![CDATA[Geplante Task]]></category>
		<category><![CDATA[Hintergrund]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[verstecken]]></category>
		<category><![CDATA[XAMPP]]></category>

		<guid isPermaLink="false">http://www.xcep.net/blog/?p=120</guid>
		<description><![CDATA[Um das Fenster einer Batch-Datei zu verstecken bzw. um eine Batch Datei im Hintergrund auszuführen, benötigt man eine kleine VBScript Datei, die das Verstecken des Fensters übernimmt. Eine Anwendungsfall hierfür wäre zum Beispiel das Ausführen eines Cronjobs auf einer lokalen PHP Entwicklungsumgebung mit einem &#8220;XAMPP-Server&#8221;. Zunächst wird die Batch-Datei erstellt, die das PHP-Skript über die [...]]]></description>
			<content:encoded><![CDATA[<p>Um das Fenster einer Batch-Datei zu verstecken bzw. um eine Batch Datei im Hintergrund auszuführen, benötigt man eine kleine VBScript Datei, die das Verstecken des Fensters übernimmt.<br />
Eine Anwendungsfall hierfür wäre zum Beispiel das Ausführen eines Cronjobs auf einer lokalen PHP Entwicklungsumgebung mit einem &#8220;XAMPP-Server&#8221;.<br />
Zunächst wird die Batch-Datei erstellt, die das PHP-Skript über die &#8220;php-win.exe&#8221; des Servers aufruft. Ich nenne sie einfach mal &#8220;cron.bat&#8221; mit folgendem Inhalt:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">X:\<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>PFAD-ZUR-PHP-WIN.EXE<span style="">&#93;</span>\php-win.exe X:\<span style="">&#91;</span>PFAD-ZUR-PHP-DATEI-DIE-AUSGEFÜHRT-WERDEN-SOLL<span style="">&#93;</span></span>\jobs.php</pre></div></div>

<p>Als nächstes braucht man noch die VBScript Datei, um das Fenster der Batch-Datei zu verstecken. Ich nenne sie &#8220;hidden.vbs&#8221; und der Inhalt sieht wie folgt aus:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #E56717; font-weight: bold;">CreateObject</span>(<span style="color: #800000;">&quot;Wscript.Shell&quot;</span>).Run <span style="color: #800000;">&quot;&quot;</span><span style="color: #800000;">&quot;&quot;</span> &amp;amp; WScript.Arguments(0) &amp;amp; <span style="color: #800000;">&quot;&quot;</span><span style="color: #800000;">&quot;&quot;</span>, 0, <span style="color: #00C2FF; font-weight: bold;">False</span></pre></div></div>

<p>Wenn man jetzt unter &#8220;START -&gt; Ausführen&#8221; folgendes eingibt, wird die Batch-Datei ausgeführt aber ohne, dass man ein Fenster sieht:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">wscript.exe <span style="color: #933;">&quot;X:\[PFAD-ZUR-HIDDEN.VBS]\hidden.vbs&quot;</span> <span style="color: #933;">&quot;X:\[PFAD-ZUR-BATCH-DATEI]\cron.bat&quot;</span></pre></div></div>

<p>Diesen Befehl kann man jetzt zum Beispiel als &#8220;Geplante Task&#8221; in Windows alle 5 Minuten ausführen lassen und erreicht dadurch eine in meinen Augen einfache Cronjob-Lösung für eine lokale Entwicklungsumgebung ohne zusätzliche Software.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.xcep.net/blog/2009/05/24/howto-das-fenster-einer-ausgefuhrten-batch-datei-verstecken-cronjob/index.php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

