<?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>Tuts4Tech &#187; scripting</title>
	<atom:link href="http://tuts4tech.net/tag/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://tuts4tech.net</link>
	<description>Tech Tutorials</description>
	<lastBuildDate>Tue, 04 May 2010 20:35:37 +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>Basic Batch Scripting</title>
		<link>http://tuts4tech.net/2009/06/24/basic-batch-scripting/</link>
		<comments>http://tuts4tech.net/2009/06/24/basic-batch-scripting/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 15:51:26 +0000</pubDate>
		<dc:creator>Duffy</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[basic]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[notepad]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[short]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://tuts4tech.net/?p=355</guid>
		<description><![CDATA[Introduction So first of all what is batch file? Its a file with a list of commands that are executed by command prompt(CMD) to open your cmd window go to start &#62; run &#62; cmd Basic Commands [batch]@echo off[/batch] This removes the "C:\Documents and Settings\Administrator&#62;" part [batch]cls[/batch] This clears all writing off the CMD window [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p><img src="http://tuts4tech.net/wp-content/uploads/2009/06/cmd.jpg" alt="cmd" title="cmd" width="500" height="253" class="aligncenter size-full wp-image-577" /><br />
So first of all what is batch file? Its a file with a list of commands that are executed by command prompt(CMD) to open your cmd window go to start &gt; run &gt; cmd</p>
<h3>Basic Commands</h3>
<ol>
<li>
[batch]@echo off[/batch]<br />
This removes the "C:\Documents and Settings\Administrator&gt;" part</li>
<li>
[batch]cls[/batch]<br />
This clears all writing off the CMD window</li>
<li>
[batch]color backgroundcolor-textcolor[/batch]<br />
This allows you to change the color of the text</p>
<pre class="brush: plain; title: ; notranslate">0 = Black       8 = Gray
1 = Blue        9 = Light Blue
2 = Green       A = Light Green
3 = Aqua        B = Light Aqua
4 = Red         C = Light Red
5 = Purple      D = Light Purple
6 = Yellow      E = Light Yellow
7 = White       F = Bright White</pre>
<p>Example command:<br />
[batch]color 04[/batch]<br />
This example would give you red text on a black background</li>
<li>
[batch]goto TEXT[/batch]<br />
This will cause the script to go to a particular section of the script it will be explained more later on in this tutorial</li>
<li>
[batch]pause[/batch]<br />
This Pauses the command prompt and displays the message press any key to continue...</li>
</ol>
<p><span id="more-355"></span></p>
<h3>Your first batch script</h3>
<p>For this example we will make a simple hello world script.</p>
<p>To get started open up notepad start &gt; all programs &gt; accessories &gt; notepad<br />
[batch]@echo off<br />
color 64<br />
echo hello world<br />
pause[/batch]<br />
Save it with a .bat extension and then double click on it to run it. It should print the text "hello world" in red font on a yellow background and then pause</p>
<h3>The goto command</h3>
<p>The goto command tells the script to go to a certain part of it<br />
[batch]goto bush[/batch]<br />
this will cause the script to go to the line that starts with<br />
[batch]:bush[/batch]<br />
Example:<br />
[batch]@echo off<br />
echo Hello, this script will repeat the message "you will see this over and over again" to cancel it press ctrl+c<br />
pause<br />
:bush<br />
echo you will see this over and over again<br />
goto bush[/batch]<br />
The message was repeated because after it was printed the goto command made the script start again from :bush</p>
<h3>Launching programs from a batch script</h3>
<p>Using the start command we can start programs</p>
<p>Example:<br />
[batch]@echo off<br />
color f1<br />
echo this script will open google.com in your default internet browser<br />
pause<br />
start http://www.google.com[/batch]</p>
]]></content:encoded>
			<wfw:commentRss>http://tuts4tech.net/2009/06/24/basic-batch-scripting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

