<?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>LosByers- Interesting Musings Helpful Hints from a Unix System Administrator &#187; BAT</title>
	<atom:link href="http://losbyers.com/wordpress/tag/bat/feed/" rel="self" type="application/rss+xml" />
	<link>http://losbyers.com/wordpress</link>
	<description>All the info I need</description>
	<lastBuildDate>Fri, 30 Mar 2012 15:56:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Windows Scheduled Task Log Output</title>
		<link>http://losbyers.com/wordpress/2009/12/windows-scheduled-task-log-output/</link>
		<comments>http://losbyers.com/wordpress/2009/12/windows-scheduled-task-log-output/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 18:26:35 +0000</pubDate>
		<dc:creator>LosByers</dc:creator>
				<category><![CDATA[Web Related]]></category>
		<category><![CDATA[BAT]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://losbyers.com/wordpress/?p=93</guid>
		<description><![CDATA[<p>I needed to have a script list and kill processes and I needed that script to run out of a scheduled task.</p> <p>It would be nice to know what happened with the script when it runs early in the morning.</p> <p>I found  that if you call the script from the Windows Task Scheduler that you [...]]]></description>
			<content:encoded><![CDATA[<p><span>I needed to have a script list and kill processes and I needed that script to run out of a scheduled task.</span></p>
<p>It would be nice to know what happened with the script when it runs early in the morning.</p>
<p>I found  that if you call the script from the Windows Task Scheduler that you can give the job a few more options.</p>
<p>Change the scheduled tasks to read as<br />
<span style="font-weight: bold;">cmd <span style="font-style: italic;">/C NightlyBatchJob.bat &gt; NightlyBatchJob.output.txt 2&gt;&amp;1</span></span></p>
<p>The output should be placed in the same directory as the script.</p>
<p><span>I also should include the script that stops all of the java processes for Wallstreet systems CMM/TRM application.</span></p>
<p><span><span id="more-93"></span></span></p>
<pre>
<pre>REM Win 2003 systems have the sleep command
REM sleep 40
REM XP systems don't.
REM The ping command times out at 20 seconds, goofy way to create a wait.
REM Comment out either the ping or the sleep depending on which works</pre>
<p>cd \&lt;install_path&gt;\pmm\bin</p>
<p>REM force PMAD/PMSD to start, in case they are not running<br />
net start "Wallstreet Suite - pmad"<br />
net start "Wallstreet Suite - pmsd"</p>
<p>.\pm_cmd admin_account/password@localhost:8887 stop SDM@test1<br />
.\pm_cmd admin_account/password@localhost:8887 stop ACM@test1<br />
.\pm_cmd admin_account/password@localhost:8887 stop websuite_appserver@test1<br />
.\pm_cmd admin_account/password@localhost:8887 stop WebSuite@test1<br />
.\pm_cmd admin_account/password@localhost:8887 stop cmm_tcmd_appserver@test1</p>
<p>REM sleep 40<br />
ping 10.10.10.254 &gt; NUL<br />
ping 10.10.10.254 &gt; NUL</p>
<p>.\pm_cmd admin_account/password@localhost:8887 stop TRM@test1</p>
<p>ping 10.10.10.254 &gt; NUL<br />
ping 10.10.10.254 &gt; NUL</p>
<p>.\pm_cmd admin_account/password@localhost:8887 stop messaging@test1<br />
.\pm_cmd admin_account/password@localhost:8887 stop active_mq@test1<br />
.\pm_cmd admin_account/password@localhost:8887 stop trm_mdsd@test1<br />
.\pm_cmd admin_account/password@localhost:8887 stop omninames@test1</p>
<p>REM Only stop  pmad/pmsd if really necessary<br />
REM net stop "Wallstreet Suite - pmsd"<br />
REM net stop "Wallstreet Suite - pmad"</p>
<p>REM sleep 20<br />
ping 10.10.10.254 &gt; NUL</p>
<p>REM Display processes status if needed<br />
.\pm_cmd admin_account/password@localhost:8887 proc</p>
<p>REM sleep 40<br />
ping 10.10.10.254 &gt; NUL<br />
ping 10.10.10.254 &gt; NUL</p>
<p>REM Make sure everything is down by killing any hung processes.<br />
.\pm_cmd admin_account/password@localhost:8887 kill WALLSTREET_SUITE@test1</p>
<p>REM sleep 40<br />
ping 10.10.10.254 &gt; NUL<br />
ping 10.10.10.254 &gt; NUL<br />
REM List out the remaining running tasks owned by SYSTEM<br />
tasklist /S localhost /U SYSTEM<br />
REM Kill any left over java processes. NOTE: will kill ALL JAVA processes on the system<br />
taskkill /F /FI "IMAGENAME eq java*"</pre>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Flosbyers.com%2Fwordpress%2F2009%2F12%2Fwindows-scheduled-task-log-output%2F&amp;title=Windows%20Scheduled%20Task%20Log%20Output" id="wpa2a_2"><img src="http://losbyers.com/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://losbyers.com/wordpress/2009/12/windows-scheduled-task-log-output/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

