<?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>zoombody &#187; scripting</title>
	<atom:link href="http://zoombody.com/tag/scripting/feed" rel="self" type="application/rss+xml" />
	<link>http://zoombody.com</link>
	<description>by Dan Rice</description>
	<lastBuildDate>Fri, 30 Jul 2010 15:37:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Run a Windows (&#8221;DOS&#8221;) batch/cmd script minimized</title>
		<link>http://zoombody.com/articles/run-a-batch-script-minimized</link>
		<comments>http://zoombody.com/articles/run-a-batch-script-minimized#comments</comments>
		<pubDate>Wed, 17 Dec 2008 17:44:46 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://zoombody.com/?p=50</guid>
		<description><![CDATA[Here&#8217;s a snippet of code I wrote that will force a Windows batch script to run in a minimized window. Insert it at the beginning of the script:

if not &#34;%minimized%&#34;==&#34;&#34; goto :minimized
set minimized=true
start /min cmd /C &#34;%~dpnx0&#34;
goto :EOF
:minimized
rem Anything after here will run in a minimized window

It works by having the script re-launch itself in [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a snippet of code I wrote that will force a Windows batch script to run in a minimized window. Insert it at the beginning of the script:</p>

<div class="wp_syntax"><div class="code"><pre class="dos dos" style="font-family:monospace;"><span style="color: #00b100; font-weight: bold;">if</span> <span style="color: #000000; font-weight: bold;">not</span> &quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">minimized</span><span style="color: #33cc33;">%</span>&quot;==&quot;&quot; <span style="color: #00b100; font-weight: bold;">goto</span> <span style="color: #b100b1; font-weight: bold;">:minimized</span>
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">minimized</span>=true
start /min cmd /C &quot;<span style="color: #33cc33;">%</span>~dpnx0&quot;
<span style="color: #00b100; font-weight: bold;">goto</span> <span style="color: #b100b1; font-weight: bold;">:EOF</span>
:<span style="color: #b100b1; font-weight: bold;">minimized</span>
<span style="color: #808080; font-style: italic;">rem</span> Anything after here will run <span style="color: #00b100; font-weight: bold;">in</span> a minimized window</pre></div></div>

<p>It works by having the script re-launch itself in a new minimized window. There are a few juicy batch scripting tricks in here that I recently picked up, like the <code>%~dpnx0</code> syntax and the special <code>:EOF</code> label. And the overall flag/callback syntax is generally useful for creating self-contained batch scripts.</p>
<p>Other <code>start</code> switches besides <code>/min</code> can provide different parameters for the child window, such as adjusting the CPU priority of the resulting process.</p>
]]></content:encoded>
			<wfw:commentRss>http://zoombody.com/articles/run-a-batch-script-minimized/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
