<?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; Troubleshooting</title>
	<atom:link href="http://grootveld.com/archives/category/troubleshooting/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>
	</channel>
</rss>
