<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: Why my scheduled task completes with return code 2	</title>
	<atom:link href="https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=why-my-scheduled-task-completes-with-return-code-2</link>
	<description></description>
	<lastBuildDate>Tue, 24 Jan 2023 18:21:06 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: James Young		</title>
		<link>https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-266194</link>

		<dc:creator><![CDATA[James Young]]></dc:creator>
		<pubDate>Tue, 13 Dec 2022 18:15:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.kjctech.net/?p=1667#comment-266194</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-11816&quot;&gt;Jeff Doncaster&lt;/a&gt;.

Jeff, THANK YOU so much for your contribution to this blog. I have been struggling with what the heck was going on with my scheduled task calling a batch file. It would run manually, but wouldn&#039;t run as a scheduled task. It was because of EXACTLY what you said. It&#039;s having an issue with the mapped drive I was referring to. You my friend are a lifesaver!!!!]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-11816">Jeff Doncaster</a>.</p>
<p>Jeff, THANK YOU so much for your contribution to this blog. I have been struggling with what the heck was going on with my scheduled task calling a batch file. It would run manually, but wouldn&#8217;t run as a scheduled task. It was because of EXACTLY what you said. It&#8217;s having an issue with the mapped drive I was referring to. You my friend are a lifesaver!!!!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kent Chen		</title>
		<link>https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-145816</link>

		<dc:creator><![CDATA[Kent Chen]]></dc:creator>
		<pubDate>Fri, 07 Oct 2016 17:52:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.kjctech.net/?p=1667#comment-145816</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-145807&quot;&gt;James&lt;/a&gt;.

Maybe delay the task a bit longer?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-145807">James</a>.</p>
<p>Maybe delay the task a bit longer?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: James		</title>
		<link>https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-145807</link>

		<dc:creator><![CDATA[James]]></dc:creator>
		<pubDate>Fri, 07 Oct 2016 16:27:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.kjctech.net/?p=1667#comment-145807</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-135343&quot;&gt;Grant&lt;/a&gt;.

I did all these--- Run it with highest privileges, using UNC, delay the start.  Still get the same problem. I can run my bat file manually outside the task scheduler successfully. Inside the task scheduler, I get message saying the task scheduler successfully finished the task with return code 2, and there is no report.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-135343">Grant</a>.</p>
<p>I did all these&#8212; Run it with highest privileges, using UNC, delay the start.  Still get the same problem. I can run my bat file manually outside the task scheduler successfully. Inside the task scheduler, I get message saying the task scheduler successfully finished the task with return code 2, and there is no report.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Grant		</title>
		<link>https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-135343</link>

		<dc:creator><![CDATA[Grant]]></dc:creator>
		<pubDate>Fri, 22 Jan 2016 16:30:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.kjctech.net/?p=1667#comment-135343</guid>

					<description><![CDATA[I was running into the exact same issue.  I resolved it by delaying the running of the batch to mount the drive by 1 minute after startup.  The issue I was having is the error code of 2 which meant not able to find the path.  So by delaying it, the drive was then available.]]></description>
			<content:encoded><![CDATA[<p>I was running into the exact same issue.  I resolved it by delaying the running of the batch to mount the drive by 1 minute after startup.  The issue I was having is the error code of 2 which meant not able to find the path.  So by delaying it, the drive was then available.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jeff Doncaster		</title>
		<link>https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-11816</link>

		<dc:creator><![CDATA[Jeff Doncaster]]></dc:creator>
		<pubDate>Thu, 08 May 2014 19:43:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.kjctech.net/?p=1667#comment-11816</guid>

					<description><![CDATA[In my case, it was the batch file instructions.. even though the batch file ran perfectly when launched manually, a code 2 appeared when run by the task scheduler. At first I followed advice about permissions on the batch file and any source/destinations within, then ran as user logged in instead of not, the optional &#039;start&#039; directory is not optional.. but I had it set right.. nothing worked.. UNTIL I had the batch file create its own log and discovered it did not like the references to mapped drives in its instructions. Even though the batch file runs fine manually.. I had to replace references to mapped locations with full UNC paths before they would execute properly when run by the task scheduler.]]></description>
			<content:encoded><![CDATA[<p>In my case, it was the batch file instructions.. even though the batch file ran perfectly when launched manually, a code 2 appeared when run by the task scheduler. At first I followed advice about permissions on the batch file and any source/destinations within, then ran as user logged in instead of not, the optional &#8216;start&#8217; directory is not optional.. but I had it set right.. nothing worked.. UNTIL I had the batch file create its own log and discovered it did not like the references to mapped drives in its instructions. Even though the batch file runs fine manually.. I had to replace references to mapped locations with full UNC paths before they would execute properly when run by the task scheduler.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: trevdev		</title>
		<link>https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-3311</link>

		<dc:creator><![CDATA[trevdev]]></dc:creator>
		<pubDate>Fri, 22 Jun 2012 18:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kjctech.net/?p=1667#comment-3311</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-3310&quot;&gt;Thomas Thomassen&lt;/a&gt;.

I also had this problem because I was piping the output to other files, in the scheduled task arguments. It didnt like that. So I put it all in a batch file and scheduled the batch file.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-3310">Thomas Thomassen</a>.</p>
<p>I also had this problem because I was piping the output to other files, in the scheduled task arguments. It didnt like that. So I put it all in a batch file and scheduled the batch file.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Thomas Thomassen		</title>
		<link>https://www.kjctech.net/why-my-scheduled-task-completes-with-return-code-2/comment-page-1/#comment-3310</link>

		<dc:creator><![CDATA[Thomas Thomassen]]></dc:creator>
		<pubDate>Sun, 17 Jun 2012 14:47:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.kjctech.net/?p=1667#comment-3310</guid>

					<description><![CDATA[I had an issue when I need to use net use to mount a drive with the SYSTEM account so it would be availible to CrashPlan. Under Win7 (admin no UAC) it was no problem, under Vista (admin with UAC) I got return code 2. I had to uncheck the &quot;Run with highest priveledges&quot; checkbox before it would work. 

...go figure...]]></description>
			<content:encoded><![CDATA[<p>I had an issue when I need to use net use to mount a drive with the SYSTEM account so it would be availible to CrashPlan. Under Win7 (admin no UAC) it was no problem, under Vista (admin with UAC) I got return code 2. I had to uncheck the &#8220;Run with highest priveledges&#8221; checkbox before it would work. </p>
<p>&#8230;go figure&#8230;</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
