<?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>Digital Derby &#187; windows service</title>
	<atom:link href="http://www.digitalderby.com/tag/windows-service/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.digitalderby.com</link>
	<description>The race is on</description>
	<lastBuildDate>Fri, 27 Nov 2009 05:22:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to create a Windows Service.</title>
		<link>http://www.digitalderby.com/2008/10/how-to-create-a-windows-service/</link>
		<comments>http://www.digitalderby.com/2008/10/how-to-create-a-windows-service/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 18:05:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[professional]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[windows service]]></category>

		<guid isPermaLink="false">http://digitalderby.wordpress.com/2008/10/22/how-to-create-a-windows-service/</guid>
		<description><![CDATA[While working on one of my projects .. I wanted to run background thread in windows. Its pretty simple in linux/unix kind of env.. just append &#8220;&#38;&#8221; to the command. To do the same thing in windows.. i had to use a windows service. The article has detailed steps to do the job. I was [...]]]></description>
			<content:encoded><![CDATA[<div>While working on one of my projects .. I wanted to run background thread in windows. Its pretty simple in linux/unix kind of env.. just append &#8220;&amp;&#8221; to the command.</p>
<p>To do the same thing in windows.. i had to use a windows service. The <a href="http://support.microsoft.com/kb/137890">article</a> has detailed steps to do the job.</p>
<p>I was testing the example provided in the article. The try to start Notepad as a service. When i started the service i was expecting to see the notepad window. But nothing like that happened. Not sure why.</p>
<p>To test it I created a simple php script which writes to a file.</p>
<p><em>&lt;?php</em></p>
<p><em> $filename = &#8220;c:\\temp1.txt&#8221;;<br />
$fh = fopen($filename, &#8216;w&#8217;) or die(&#8221; Fatal ERROR can&#8217;t open file&#8221;);</em></p>
<p><em> while(true) {<br />
fwrite($fh,&#8221;hi \n&#8221;);<br />
sleep(100);<br />
}<br />
fclose($fh);</em></p>
<p><em>?&gt;</em></p>
<p><em></em>And in the &#8220;Application&#8221; key of the registery provided the following command</p>
<p><em>php test.php</em></p>
<p>Now when I started the command saw the logs in c:\temp.txt file.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.digitalderby.com/2008/10/how-to-create-a-windows-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

