<?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>TuXHaT&#187; Windows Archives  &#8211; Blog Title</title>
	<atom:link href="http://www.tuxhat.com/category/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tuxhat.com</link>
	<description>Linux / sysadmin / Debian / Ubuntu / Red Hat / Centos</description>
	<lastBuildDate>Tue, 13 Oct 2009 07:25:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>starting windows shell scripting</title>
		<link>http://www.tuxhat.com/windows/starting-windows-shell-scripting/</link>
		<comments>http://www.tuxhat.com/windows/starting-windows-shell-scripting/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 04:45:28 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[FOR]]></category>
		<category><![CDATA[shell scripting]]></category>

		<guid isPermaLink="false">http://www.tuxhat.com/?p=62</guid>
		<description><![CDATA[            I recently read blog entry on &#8220;Five Windows command prompt tips every IT pro should know&#8221;,
http://blogs.techrepublic.com.com/itdojo/?p=947
    There started my desire to try win32 shell scripting. Not a full time study, just try bits and pieces which may be useful in [...]]]></description>
			<content:encoded><![CDATA[<p>            I recently read blog entry on &#8220;Five Windows command prompt tips every IT pro should know&#8221;,</p>
<p>http://blogs.techrepublic.com.com/itdojo/?p=947</p>
<p>    There started my desire to try win32 shell scripting. Not a full time study, just try bits and pieces which may be useful in day to day things <img src='http://www.tuxhat.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p> TIP1:</p>
<p>   Everybody likes comments to there scripts. In win32 shell any line starting with :: is a comment</p>
<p>:: This is a comment</p>
<p> TIP2:</p>
<p>     Conditional loops are favorites for all sysadmin in their daily tasks. For eg: one would use a for loop in bash to list a directory and do some stuff on the files and sub-folders in it. Like below,</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;color: #FCFFBA;"><span style="color: #000000; font-weight: bold;color: #B83A24;">for</span> n <span style="color: #000000; font-weight: bold;color: #B83A24;">in</span> <span style="color: #000000; font-weight: bold;color: #CCC;">*</span> ;<span style="color: #000000; font-weight: bold;color: #B83A24;">do</span> <span style="color: #7a0874; font-weight: bold;color: #8FB394;">echo</span> <span style="color: #007800;color: blue;">$n</span>; <span style="color: #000000; font-weight: bold;color: #B83A24;">done</span></pre></div></div>

<p> This will display the contents of current working directory.</p>
<p>   How will you do it in a windows shell ? Here it is,</p>
<p>  Try this in a windows command prompt,</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;color: #FCFFBA;">:<span style="color: #b100b1; font-weight: bold;">: <span style="color: #b1b100; font-weight: bold;color: #8FB394;">echo</span> off will disable echoing the commands back to stdout</span>
  <span style="color: #33cc33;color: #CCC;">@</span><span style="color: #b1b100; font-weight: bold;color: #8FB394;">echo</span> off</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;color: #FCFFBA;">:<span style="color: #b100b1; font-weight: bold;">: Here %<span style="color: #448888;">V</span> is a single letter replaceable variable</span>
  <span style="color: #00b100; font-weight: bold;color: #B83A24;">FOR</span> /F &quot;tokens=*&quot; <span style="color: #33cc33;color: #CCC;">%</span><span style="color: #448888;">V</span> <span style="color: #00b100; font-weight: bold;color: #B83A24;">IN</span> <span style="color: #66cc66;color: #CCC;">&#40;</span>'<span style="color: #b1b100; font-weight: bold;color: #8FB394;">dir</span> /b .'<span style="color: #66cc66;color: #CCC;">&#41;</span> <span style="color: #00b100; font-weight: bold;color: #B83A24;">DO</span> <span style="color: #b1b100; font-weight: bold;color: #8FB394;">echo</span> <span style="color: #33cc33;color: #CCC;">%</span><span style="color: #448888;">V</span></pre></div></div>

<p> If  you are putting the command in a batch script %V should be replaced with %%V.</p>
<p> Try out another interesting eg:</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;color: #FCFFBA;"> <span style="color: #00b100; font-weight: bold;color: #B83A24;">FOR</span> /L <span style="color: #33cc33;color: #CCC;">%</span><span style="color: #448888;">i</span> <span style="color: #00b100; font-weight: bold;color: #B83A24;">IN</span> <span style="color: #66cc66;color: #CCC;">&#40;</span><span style="color: #cc66cc;color: #DDD;">0</span> <span style="color: #cc66cc;color: #DDD;">2</span> <span style="color: #cc66cc;color: #DDD;">100</span><span style="color: #66cc66;color: #CCC;">&#41;</span> <span style="color: #00b100; font-weight: bold;color: #B83A24;">DO</span> <span style="color: #b1b100; font-weight: bold;color: #8FB394;">echo</span> <span style="color: #33cc33;color: #CCC;">%</span><span style="color: #448888;">i</span></pre></div></div>

<p>            Which will simply, echo all the numbers in between zero and 100 inclusive, incrementing by 2 each time.</p>
<p> Try &#8216;for /?&#8217; for help page <img src='http://www.tuxhat.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuxhat.com/windows/starting-windows-shell-scripting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setup terminal session timeouts in windows server 2003</title>
		<link>http://www.tuxhat.com/windows/setup-terminal-session-timeouts-windows-server-2003/</link>
		<comments>http://www.tuxhat.com/windows/setup-terminal-session-timeouts-windows-server-2003/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 04:21:17 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Terminal service]]></category>
		<category><![CDATA[windows 2003 server]]></category>

		<guid isPermaLink="false">http://www.tuxhat.com/?p=13</guid>
		<description><![CDATA[* Take Group policy editor
* Computer Configuration \ Administrative Templates \ Windows Components \ Terminal Services \ Session \
More details can be found here,
http://technet.microsoft.com/en-us/library/cc753112.aspx
]]></description>
			<content:encoded><![CDATA[<p>* Take Group policy editor</p>
<p>* Computer Configuration \ Administrative Templates \ Windows Components \ Terminal Services \ Session \</p>
<p>More details can be found here,</p>
<p>http://technet.microsoft.com/en-us/library/cc753112.aspx</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tuxhat.com/windows/setup-terminal-session-timeouts-windows-server-2003/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
