<?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>Arnout's Eclectica &#187; Reminder</title>
	<atom:link href="http://grootveld.com/archives/category/reminder/feed" rel="self" type="application/rss+xml" />
	<link>http://grootveld.com</link>
	<description>But I digress...</description>
	<lastBuildDate>Wed, 10 Feb 2010 20:00:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Troubleshooting a scheduled task</title>
		<link>http://grootveld.com/archives/30/troubleshooting-a-scheduled-task</link>
		<comments>http://grootveld.com/archives/30/troubleshooting-a-scheduled-task#comments</comments>
		<pubDate>Fri, 28 Nov 2008 22:59:14 +0000</pubDate>
		<dc:creator>amg</dc:creator>
				<category><![CDATA[Reminder]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://grootveld.com/archives/30</guid>
		<description><![CDATA[How to run <code>cmd.exe</code> non-interactively if you're not an admin.]]></description>
			<content:encoded><![CDATA[<p>Earlier today, I was trying to run a batch file as a scheduled task, using a non-admin service account. It didn't work, but the scheduled tasks interface didn't provide a lot of info to go on.</p>
<p>After double-checking file system permissions, and running Filemon to try and figure out where stuff was failing, I found out that the task scheduler actually creates a log file. By default it seems to live at <code>%SystemRoot%\Tasks\SchedLgU.Txt</code>, but that location can be changed in the registry by modifying the <code>LogPath</code> value at <code>HKLM\SOFTWARE\Microsoft\SchedulingAgent</code>.</p>
<p>That log file contained an error message (well, several...) that quickly lead me to Microsoft Knowledgebase article <a href='http://support.microsoft.com/kb/867466' title='Microsoft Knowledgebase article about &#39;Access Denied&#39; errors in scheduled tasks'>KB867466</a>. Turns out that on Windows Server 2003 member servers, non-admin users running non-interactively don't have Read or Execute permissions to <code>cmd.exe</code>...</p>
<p>After fixing the permissions, the job ran fine.</p>
<p>That's when I discovered that the batch file was making some assumptions w.r.t. the user's regional settings, so I switched to a VBScript instead. If I'd done that in the first place, I wouldn't have had to spend 15 minutes fighting with the task scheduler, since the permissions issue doesn't apply to <code>cscript.exe</code>...</p>
<p>Oh well.</p>
]]></content:encoded>
			<wfw:commentRss>http://grootveld.com/archives/30/troubleshooting-a-scheduled-task/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synchronizing two batch files using WAITFOR.exe</title>
		<link>http://grootveld.com/archives/28/synchronizing-two-batch-files-using-waitforexe</link>
		<comments>http://grootveld.com/archives/28/synchronizing-two-batch-files-using-waitforexe#comments</comments>
		<pubDate>Thu, 28 Aug 2008 20:58:08 +0000</pubDate>
		<dc:creator>amg</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Reminder]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://grootveld.com/archives/28</guid>
		<description><![CDATA[I was writing some unit tests today where I wanted to start some process asynchronously, but have it automatically exit after a specified number of seconds. Preferably something that's available on a standard W2K3 box, so that I wouldn't be creating any additional prerequisites for other developer boxes or the build machine.
Usually I just use [...]]]></description>
			<content:encoded><![CDATA[<p>I was writing some unit tests today where I wanted to start some process asynchronously, but have it automatically exit after a specified number of seconds. Preferably something that's available on a standard W2K3 box, so that I wouldn't be creating any additional prerequisites for other developer boxes or the build machine.</p>
<p>Usually I just use <code>ping -t -n <i>count</i> <i>host</i></code> for this, but I was also thinking that it would be nice to be able to terminate the process before the timeout. Not sure exactly how I came across it, but somehow I found <code>waitfor.exe</code> lying around in my <code>system32</code> directory.</p>
<p><code>WAITFOR</code> uses a <a href='http://msdn.microsoft.com/en-us/library/aa365576(VS.85).aspx' title='Documentation for Win32 mailslots at Microsoft'>mailslot</a> to wait on or send a signal to. The waiting and sending can happen on the same machine, or the signal can be sent across the network.</p>
<p>In one command prompt, you perform the wait:</p>
<pre class="dosbox">C:\\> WAITFOR /T 42 SignalName</pre>
<p>In another, you send the signal:</p>
<pre class="dosbox">C:\\> WAITFOR /SI SignalName</pre>
<p>Way nicer than the old-fashioned approach of having process A poll a directory until process B has created a particular file. And, no less important, if the signal is not received within the specified timeout, you get:</p>
<pre class="dosbox">C:\\> WAITFOR /T 1 Godot
ERROR: Timed out waiting for 'Godot'.

C:\\>_</pre>
<p>:-)</p>
]]></content:encoded>
			<wfw:commentRss>http://grootveld.com/archives/28/synchronizing-two-batch-files-using-waitforexe/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Making HttpWebRequest work while having Fiddler decrypt SSL</title>
		<link>http://grootveld.com/archives/22/making-httpwebrequest-work-while-having-fiddler-decrypt-ssl</link>
		<comments>http://grootveld.com/archives/22/making-httpwebrequest-work-while-having-fiddler-decrypt-ssl#comments</comments>
		<pubDate>Thu, 29 May 2008 11:54:49 +0000</pubDate>
		<dc:creator>amg</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Reminder]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://grootveld.com/archives/22</guid>
		<description><![CDATA[Just a quick reminder to myself, so that I can forget about it...
Fiddler can act as a man-in-the-middle and decrypt SSL traffic, but then System.Net.Security rightfully complains about an invalid remote certificate ("The remote certificate is invalid according to the validation procedure."). This results in a System.Net.WebException "The underlying connection was closed: Could not establish [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick reminder to myself, so that I can forget about it...</p>
<p><a href='http://www.fiddlertool.com'>Fiddler</a> can act as a man-in-the-middle and decrypt SSL traffic, but then System.Net.Security rightfully complains about an invalid remote certificate ("The remote certificate is invalid according to the validation procedure."). This results in a System.Net.WebException "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.".</p>
<p>To prevent this from happening:</p>
<pre class="codesample">
<span style="color: #2b91af;">ServicePointManager</span>.ServerCertificateValidationCallback = <span style="color: blue;">delegate</span> { <span style="color: blue;">return</span> <span style="color: blue;">true</span>; };
</pre>
<p>Just be sure to not include this in production code :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://grootveld.com/archives/22/making-httpwebrequest-work-while-having-fiddler-decrypt-ssl/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
