<?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: Using variables in Windows batch files</title>
	<atom:link href="http://www.tech-recipes.com/rx/630/using-variables-in-windows-batch-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tech-recipes.com/rx/630/using-variables-in-windows-batch-files/</link>
	<description>Computer and technology tutorials and guides</description>
	<lastBuildDate>Thu, 09 Feb 2012 21:01:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: hswipf</title>
		<link>http://www.tech-recipes.com/rx/630/using-variables-in-windows-batch-files/comment-page-1/#comment-53410</link>
		<dc:creator>hswipf</dc:creator>
		<pubDate>Sat, 21 Jan 2012 00:18:55 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-53410</guid>
		<description>I&#039;ve seen %%a or %%x used here or other sites that explain how to use variables in batch files - BUT NO ONE EXPLAINS THE %%A.  When you copy and paste a command that should read all the lines from a file and echo or process each line I get a:

%%A was unexpected at this time.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve seen %%a or %%x used here or other sites that explain how to use variables in batch files &#8211; BUT NO ONE EXPLAINS THE %%A.  When you copy and paste a command that should read all the lines from a file and echo or process each line I get a:</p>
<p>%%A was unexpected at this time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eduardo Oliveira</title>
		<link>http://www.tech-recipes.com/rx/630/using-variables-in-windows-batch-files/comment-page-1/#comment-51079</link>
		<dc:creator>Eduardo Oliveira</dc:creator>
		<pubDate>Sat, 29 Oct 2011 14:55:24 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-51079</guid>
		<description>I was needing a help to unset a variable, and i find it here!
And reading the comments learn how to read args in bat/cmd and how to make a loop in a really easy way!

Thanks for your post and commenters!</description>
		<content:encoded><![CDATA[<p>I was needing a help to unset a variable, and i find it here!<br />
And reading the comments learn how to read args in bat/cmd and how to make a loop in a really easy way!</p>
<p>Thanks for your post and commenters!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Basta</title>
		<link>http://www.tech-recipes.com/rx/630/using-variables-in-windows-batch-files/comment-page-1/#comment-48180</link>
		<dc:creator>Andrew Basta</dc:creator>
		<pubDate>Tue, 26 Apr 2011 13:51:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-48180</guid>
		<description>I don&#039;t like Windows-style data output and using %date:~6,4%-%date:~3,2%-%date:~0,2% for backup, it gives YYYY-MM-DD format</description>
		<content:encoded><![CDATA[<p>I don&#8217;t like Windows-style data output and using %date:~6,4%-%date:~3,2%-%date:~0,2% for backup, it gives YYYY-MM-DD format</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sonoma</title>
		<link>http://www.tech-recipes.com/rx/630/using-variables-in-windows-batch-files/comment-page-1/#comment-46847</link>
		<dc:creator>sonoma</dc:creator>
		<pubDate>Wed, 02 Mar 2011 23:55:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-46847</guid>
		<description>I like the nested () after the do in the for loop.  But seem to be having problems with nested for loops within it, as I want to take the first loop variable and add the second loop variable to it using the SET /A command...doesn&#039;t seem to work.  would be a great way to increment or decrement a number for file manipulation....
any ideas?
</description>
		<content:encoded><![CDATA[<p>I like the nested () after the do in the for loop.  But seem to be having problems with nested for loops within it, as I want to take the first loop variable and add the second loop variable to it using the SET /A command&#8230;doesn&#8217;t seem to work.  would be a great way to increment or decrement a number for file manipulation&#8230;.<br />
any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Potranquito</title>
		<link>http://www.tech-recipes.com/rx/630/using-variables-in-windows-batch-files/comment-page-1/#comment-46312</link>
		<dc:creator>Potranquito</dc:creator>
		<pubDate>Fri, 11 Feb 2011 06:16:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-46312</guid>
		<description>The next code does the job. I know it does the job using a different approach, but I guess the end result is the same as you wanted it.
Hope it helps...
Note: Because of the line &quot;set /a count=%count%+1&quot; this script works well under cmd, but not under good old command.com.

SET count=0

:new_col
set /a count=%count%+1
if %count%==9 goto end
SET Colour=Colour%count%
goto get_col

:get_col
if &quot;%Colour%&quot;==&quot;Colour1&quot; set Colour=BLACK
if &quot;%Colour%&quot;==&quot;Colour2&quot; set Colour=BLUE
if &quot;%Colour%&quot;==&quot;Colour3&quot; set Colour=GREEN
if &quot;%Colour%&quot;==&quot;Colour4&quot; set Colour=CYAN
if &quot;%Colour%&quot;==&quot;Colour5&quot; set Colour=RED
if &quot;%Colour%&quot;==&quot;Colour6&quot; set Colour=PURPLE
if &quot;%Colour%&quot;==&quot;Colour7&quot; set Colour=ORANGE
if &quot;%Colour%&quot;==&quot;Colour8&quot; set Colour=GRAY
goto show_col

:show_col
ECHO Colour is %Colour%
goto new_col

:end</description>
		<content:encoded><![CDATA[<p>The next code does the job. I know it does the job using a different approach, but I guess the end result is the same as you wanted it.<br />
Hope it helps&#8230;<br />
Note: Because of the line &#8220;set /a count=%count%+1&#8243; this script works well under cmd, but not under good old command.com.</p>
<p>SET count=0</p>
<p>:new_col<br />
set /a count=%count%+1<br />
if %count%==9 goto end<br />
SET Colour=Colour%count%<br />
goto get_col</p>
<p>:get_col<br />
if &#8220;%Colour%&#8221;==&#8221;Colour1&#8243; set Colour=BLACK<br />
if &#8220;%Colour%&#8221;==&#8221;Colour2&#8243; set Colour=BLUE<br />
if &#8220;%Colour%&#8221;==&#8221;Colour3&#8243; set Colour=GREEN<br />
if &#8220;%Colour%&#8221;==&#8221;Colour4&#8243; set Colour=CYAN<br />
if &#8220;%Colour%&#8221;==&#8221;Colour5&#8243; set Colour=RED<br />
if &#8220;%Colour%&#8221;==&#8221;Colour6&#8243; set Colour=PURPLE<br />
if &#8220;%Colour%&#8221;==&#8221;Colour7&#8243; set Colour=ORANGE<br />
if &#8220;%Colour%&#8221;==&#8221;Colour8&#8243; set Colour=GRAY<br />
goto show_col</p>
<p>:show_col<br />
ECHO Colour is %Colour%<br />
goto new_col</p>
<p>:end</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jalal ud Din</title>
		<link>http://www.tech-recipes.com/rx/630/using-variables-in-windows-batch-files/comment-page-1/#comment-44528</link>
		<dc:creator>Jalal ud Din</dc:creator>
		<pubDate>Mon, 06 Dec 2010 12:14:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-44528</guid>
		<description>have you found the answer? I have the same problem</description>
		<content:encoded><![CDATA[<p>have you found the answer? I have the same problem</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Me</title>
		<link>http://www.tech-recipes.com/rx/630/using-variables-in-windows-batch-files/comment-page-1/#comment-43330</link>
		<dc:creator>Me</dc:creator>
		<pubDate>Wed, 20 Oct 2010 14:27:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-43330</guid>
		<description>How about answering the question &#039;using variables in batch files&#039; ...
printing the variables doesn&#039;t really amount to &#039;use&#039;</description>
		<content:encoded><![CDATA[<p>How about answering the question &#8216;using variables in batch files&#8217; &#8230;<br />
printing the variables doesn&#8217;t really amount to &#8216;use&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phatsta</title>
		<link>http://www.tech-recipes.com/rx/630/using-variables-in-windows-batch-files/comment-page-1/#comment-43321</link>
		<dc:creator>Phatsta</dc:creator>
		<pubDate>Wed, 20 Oct 2010 08:17:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-43321</guid>
		<description>When you&#039;ve learned this it&#039;s easy to use it for backup purposes, like this one:

-----------------------------------------------------------------------------
md &quot;C:testBackup %date%&quot;
set bkpdir=&quot;C:testBackup %date%&quot;

xcopy C:temp %bkpdir% /E /C /Q /H /Y
-----------------------------------------------------------------------------

All you have to do is schedule this script to run each night or whenever you like, using windows scheduler. Works like a charm :)</description>
		<content:encoded><![CDATA[<p>When you&#8217;ve learned this it&#8217;s easy to use it for backup purposes, like this one:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
md &#8220;C:testBackup %date%&#8221;<br />
set bkpdir=&#8221;C:testBackup %date%&#8221;</p>
<p>xcopy C:temp %bkpdir% /E /C /Q /H /Y<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>All you have to do is schedule this script to run each night or whenever you like, using windows scheduler. Works like a charm :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OrangeBoxTutorials</title>
		<link>http://www.tech-recipes.com/rx/630/using-variables-in-windows-batch-files/comment-page-1/#comment-43063</link>
		<dc:creator>OrangeBoxTutorials</dc:creator>
		<pubDate>Sun, 10 Oct 2010 20:28:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-43063</guid>
		<description>Thanks, just needed this for my tutorial! :D</description>
		<content:encoded><![CDATA[<p>Thanks, just needed this for my tutorial! :D</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Helpme</title>
		<link>http://www.tech-recipes.com/rx/630/using-variables-in-windows-batch-files/comment-page-1/#comment-42492</link>
		<dc:creator>Helpme</dc:creator>
		<pubDate>Sat, 18 Sep 2010 09:02:00 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-42492</guid>
		<description>Hello,
In bat scripting how can i get the value of a variable within a variable.
Ex:
SET Colour1=RED
SET Colour2=BLUE
SET Colour3=GREEN
SET count=1
SET Colour=Colour%count%
ECHO Colour is %Colour%

Now Color shows Color1, as output...
How can i get Colour to show value of Color1 ie RED</description>
		<content:encoded><![CDATA[<p>Hello,<br />
In bat scripting how can i get the value of a variable within a variable.<br />
Ex:<br />
SET Colour1=RED<br />
SET Colour2=BLUE<br />
SET Colour3=GREEN<br />
SET count=1<br />
SET Colour=Colour%count%<br />
ECHO Colour is %Colour%</p>
<p>Now Color shows Color1, as output&#8230;<br />
How can i get Colour to show value of Color1 ie RED</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached (User agent is rejected)
Database Caching 3/15 queries in 0.903 seconds using memcached
Object Caching 419/419 objects using memcached

Served from: www.tech-recipes.com @ 2012-02-10 04:27:00 -->
