<?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>zeyaLabs &#187; windows</title>
	<atom:link href="http://www.zeyalabs.ch/tags/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zeyalabs.ch</link>
	<description>Binary and Plain Stuff... and more</description>
	<lastBuildDate>Tue, 30 Nov 2010 14:27:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Echoing Parentheses in Windows Batch Files</title>
		<link>http://www.zeyalabs.ch/posts/echoing-parentheses-in-batch-files/</link>
		<comments>http://www.zeyalabs.ch/posts/echoing-parentheses-in-batch-files/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 21:33:08 +0000</pubDate>
		<dc:creator>Oldie</dc:creator>
				<category><![CDATA[Techy Articles]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[howtos]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.zeyalabs.ch/?p=235</guid>
		<description><![CDATA[It&#8217;s not just about parentheses, really. It&#8217;s about almost anything that a script engine will ruthlessly interpret before executing a command: variable markers (percent signs), redirection symbols, parentheses, double quotes, ampersands&#8230; My most common&#8230; let&#8217;s say, case, is this: Put this in a BATch file, run it, and you&#8217;ll end up with a message saying&#160;<a class="more" href="http://www.zeyalabs.ch/posts/echoing-parentheses-in-batch-files/" title="read whole article">[...]</a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not just about parentheses, really. It&#8217;s about almost anything that a script engine will ruthlessly interpret before executing a command: variable markers (percent signs), redirection symbols, parentheses, double quotes, ampersands&#8230;</p>
<p>My most common&#8230; let&#8217;s say, <em>case</em>, is this:</p>
<pre class="brush: bash; title: ; notranslate">
@echo off

echo Doing something (very important)...
</pre>
<p>Put this in a BATch file, run it, and you&#8217;ll end up with a message saying</p>
<pre class="brush: bash; light: true; title: ; notranslate">
... was unexpected at this time.
</pre>
<p>No, seriously? It&#8217;s great that the engine is trying to evaluate an expression within an <code>echo</code>, but this time I need something much more simple: round brackets embedded into a text message. Just that. Please.</p>
<p>Thank heavens there is a &#8220;cure&#8221;: parentheses can be escaped with a caret character.</p>
<pre class="brush: bash; title: ; notranslate">
@echo off

echo Doing something ^(very important^)...
</pre>
<p>Now we&#8217;re good:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
Doing something (very important)...
</pre>
<p>Carets can be used to escape almost any special character, even a newline &#8212; to break a single command in several lines.</p><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.zeyalabs.ch%2Fposts%2Fechoing-parentheses-in-batch-files%2F&amp;title=Echoing%20Parentheses%20in%20Windows%20Batch%20Files" id="wpa2a_2"><img src="http://www.zeyalabs.ch/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.zeyalabs.ch/posts/echoing-parentheses-in-batch-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

