<?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>Shell Tips ! &#187; DOS &#8211; Windows Batch Files</title>
	<atom:link href="http://www.shell-tips.com/category/dos-windows-batch-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shell-tips.com</link>
	<description>Some useful tips about CLI tools, Shell scripts and batch files... GNU Bash, Windows XP, SQL, Help Sheets / Cheat Sheets, etc.</description>
	<lastBuildDate>Fri, 04 Dec 2009 01:58:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Files and directories user permissions on Windows XP</title>
		<link>http://www.shell-tips.com/2007/01/18/files-and-directories-user-permissions-on-windows-xp/</link>
		<comments>http://www.shell-tips.com/2007/01/18/files-and-directories-user-permissions-on-windows-xp/#comments</comments>
		<pubDate>Thu, 18 Jan 2007 01:04:38 +0000</pubDate>
		<dc:creator>Nicolas Brousse</dc:creator>
				<category><![CDATA[DOS - Windows Batch Files]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.shell-tips.com/2007/01/18/files-and-directories-user-permissions-on-windows-xp/</guid>
		<description><![CDATA[You may have some troubles while using a network share on windows because of access restriction errors. Don&#8217;t panic, just use CACLS on windows XP.

Displays or modifies discretionary access control list (DACL) files.
cacls FileName [/t] [/e] [/c] [/g User:permission] [/r User [...]] [/p User:permission [...]] [/d User [...]]
FileName : Required. Displays DACLs of specified files.
/t [...]]]></description>
			<content:encoded><![CDATA[<p>You may have some troubles while using a network share on windows because of access restriction errors. Don&#8217;t panic, just use <strong>CACLS</strong> on windows XP.</p>
<p><span id="more-30"></span><br />
Displays or modifies discretionary access control list (DACL) files.</p>
<blockquote><p><strong>cacls</strong> <em>FileName</em> [<strong>/t</strong>] [<strong>/e</strong>] [<strong>/c</strong>] [<strong>/g</strong> <em>User</em><strong>:</strong><em>permission</em>] [<strong>/r</strong> <em>User</em> [...]] [<strong>/p</strong> <em>User</em><strong>:</strong><em>permission</em> [...]] [<strong>/d</strong> <em>User</em> [...]]</p>
<p><strong>FileName : </strong>Required. Displays DACLs of specified files.<br />
<strong>/t : </strong>Changes DACLs of specified files in the current directory and all subdirectories.<br />
<strong>/e : </strong>Edits a DACL instead of replacing it.<br />
<strong>/c : </strong>Continues to change DACLs, ignoring errors.<br />
<strong>/g <em>User</em> : <em>permission</em></strong> : Grants access rights to the specified user. The following table lists valid values for <em>permission</em>.<br />
<strong>/r <em>User</em> : </strong>Revokes access rights for the specified user.<br />
<strong>/p <em>User</em> : <em>permission</em> : </strong>Replaces access rights for the specified user. The following table lists valid values for <em>permission</em>.<br />
<strong>/d <em>User</em> : </strong>Denies access for the specified user.<br />
<strong>/? : </strong>Displays help at the command prompt.</p>
<p><strong>Permission possible values :</strong></p>
<p><strong>n :</strong> None</p>
<p><strong>r :</strong> Read</p>
<p><strong>w :</strong> Write</p>
<p><strong>c :</strong> Change (write)</p>
<p><strong>f :</strong> Full control</p></blockquote>
<p><strong>CACLS</strong> accept more than one user and you can use widlcards (? and *) to specify multiple files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shell-tips.com/2007/01/18/files-and-directories-user-permissions-on-windows-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Determine which Windows OS version is running</title>
		<link>http://www.shell-tips.com/2006/11/24/determine-which-windows-os-version-is-running/</link>
		<comments>http://www.shell-tips.com/2006/11/24/determine-which-windows-os-version-is-running/#comments</comments>
		<pubDate>Fri, 24 Nov 2006 06:59:53 +0000</pubDate>
		<dc:creator>Nicolas Brousse</dc:creator>
				<category><![CDATA[DOS - Windows Batch Files]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.shell-tips.com/2006/11/24/determine-which-windows-os-version-is-running/</guid>
		<description><![CDATA[Many DOS commands in the 32-bit versions of Windows are similar but support different parameters, different commands or using different registry key name. Thus, if you wish to write a batch file that can run on different types of machines, it may prove beneficial to determine the version of Windows on which the batch file [...]]]></description>
			<content:encoded><![CDATA[<p><font class="bodytext">Many DOS commands in the 32-bit versions of Windows are similar but support different parameters, different commands or using different registry key name. Thus, if you wish to write a batch file that can run on different types of machines, it may prove beneficial to determine the version of Windows on which the batch file is running. This way the batch file can execute commands appropriate to the operating system.<br />
</font></p>
<p><span id="more-19"></span><br />
The simpliest way to know the OS Version is to run the universal windows DOS command &#8220;<strong>VER</strong>&#8221; then using &#8220;<strong>FIND</strong>&#8221; on it returned result.</p>
<blockquote><p><font class="bodytext"><span class="dos"> @echo off</span></font><br />
<font class="bodytext"><span class="dos" /></font><br />
<font class="bodytext"><span class="dos">ver | find &#8220;2003&#8243; > nul</span></font><br />
<font class="bodytext"><span class="dos">if %ERRORLEVEL% == 0 goto v2003</span></font><br />
<font class="bodytext"><span class="dos" /></font><br />
<font class="bodytext"><span class="dos">ver | find &#8220;XP&#8221; > nul</span></font><br />
<font class="bodytext"><span class="dos">if %ERRORLEVEL% == 0 goto vxp</span></font><br />
<font class="bodytext"><span class="dos" /></font><br />
<font class="bodytext"><span class="dos">ver | find &#8220;2000&#8243; > nul</span></font><br />
<font class="bodytext"><span class="dos">if %ERRORLEVEL% == 0 goto v2000</span></font><br />
<font class="bodytext"><span class="dos" /></font><br />
<font class="bodytext"><span class="dos">ver | find &#8220;NT&#8221; > nul</span></font><br />
<font class="bodytext"><span class="dos">if %ERRORLEVEL% == 0 goto vnt</span></font><br />
<font class="bodytext"><span class="dos" /></font><br />
<font class="bodytext"><span class="dos">echo Unknow OS Version.</span></font><br />
<font class="bodytext"><span class="dos">goto exit</span></font><br />
<font class="bodytext"><span class="dos" /></font><br />
<font class="bodytext"><span class="dos">:v2003</span></font><br />
<font class="bodytext"><span class="dos">:Run Windows 2003 specific commands here.</span></font><br />
<font class="bodytext"><span class="dos">goto exit</span></font><br />
<font class="bodytext"><span class="dos" /></font><br />
<font class="bodytext"><span class="dos">:vxp</span></font><br />
<font class="bodytext"><span class="dos">:Run Windows XP specific commands here.</span></font><br />
<font class="bodytext"><span class="dos">goto exit</span></font><br />
<font class="bodytext"><span class="dos" /></font><br />
<font class="bodytext"><span class="dos">:v2000</span></font><br />
<font class="bodytext"><span class="dos">:Run Windows 2000 specific commands here.</span></font><br />
<font class="bodytext"><span class="dos">goto exit</span></font><br />
<font class="bodytext"><span class="dos" /></font><br />
<font class="bodytext"><span class="dos">:vnt</span></font><br />
<font class="bodytext"><span class="dos">:Run Windows NT-specific commands here.</span></font><br />
<font class="bodytext"><span class="dos">goto exit</span></font><br />
<font class="bodytext"><span class="dos" /></font><br />
<font class="bodytext"><span class="dos">:exit</span></font></p></blockquote>
<p><font class="bodytext"><br />
You can easily add the support of other versions of Windows as necessary or set an environment variable based on the version of Windows detected.</font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shell-tips.com/2006/11/24/determine-which-windows-os-version-is-running/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CLI workaround for Windows XP : Doing a pause in a batch script</title>
		<link>http://www.shell-tips.com/2006/11/07/cli-workaround-for-windows-xp-doing-a-pause-in-a-batch-script/</link>
		<comments>http://www.shell-tips.com/2006/11/07/cli-workaround-for-windows-xp-doing-a-pause-in-a-batch-script/#comments</comments>
		<pubDate>Tue, 07 Nov 2006 17:36:49 +0000</pubDate>
		<dc:creator>Nicolas Brousse</dc:creator>
				<category><![CDATA[DOS - Windows Batch Files]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.shell-tips.com/2006/11/07/cli-workaround-for-windows-xp-doing-a-pause-in-a-batch-script/</guid>
		<description><![CDATA[In our list of &#8220;CLI workaround for Windows XP&#8220;, a missing command is SLEEP or WAIT. For fixing this I suggest you two solution, first is simply a batch workaround using PING command, the second solution use the Windows Server 2003 Ressource Kit tools.
With PING you can produce a fixed delay by testing the loopback [...]]]></description>
			<content:encoded><![CDATA[<p>In our list of &#8220;<strong>CLI workaround for Windows XP</strong>&#8220;, a missing command is <strong>SLEEP</strong> or <strong>WAIT</strong>. For fixing this I suggest you two solution, first is simply a batch workaround using <strong>PING</strong> command, the second solution use the Windows Server 2003 Ressource Kit tools.</p>
<p>With PING you can produce a fixed delay by testing the loopback address. This can be really usefull if you don&#8217;t want (or if you can&#8217;t) install extra software.</p>
<blockquote><p># Doing an approximative pause of 60 seconds</p>
<p>PING -n 61 127.0.0.1>nul</p></blockquote>
<p>Second way is to install the <a title="Windows Server 2003 Resource Kit tools" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&#038;DisplayLang=en"><strong>Windows Server 2003 Resource Kit tools</strong></a> from microsoft.com. You will get a SLEEP.exe that will do all the requested stuff.</p>
<blockquote><p># Doing a pause of 60 seconds</p>
<p>SLEEP 60</p></blockquote>
<p>Enjoy. ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shell-tips.com/2006/11/07/cli-workaround-for-windows-xp-doing-a-pause-in-a-batch-script/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Customize your DOS/CMD Prompt</title>
		<link>http://www.shell-tips.com/2006/10/21/personnalize-your-doscmd-prompt/</link>
		<comments>http://www.shell-tips.com/2006/10/21/personnalize-your-doscmd-prompt/#comments</comments>
		<pubDate>Sat, 21 Oct 2006 15:24:15 +0000</pubDate>
		<dc:creator>Nicolas Brousse</dc:creator>
				<category><![CDATA[DOS - Windows Batch Files]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.shell-tips.com/2006/10/21/personnalize-your-doscmd-prompt/</guid>
		<description><![CDATA[If you want to tune your PROMPT you just need to use&#8230; the PROMPT command ! By default the prompt is set to the current path, but you can customize it a little.
# Display prompt help
PROMPT /?
# Customize your prompt
PROMPT $T $D$_$P $F
# Will give this result in my cmd window
17:11:55,31 sam. 21/10/2006
D:\Documents and Settings\Nicolas>
]]></description>
			<content:encoded><![CDATA[<p>If you want to tune your <strong>PROMPT</strong> you just need to use&#8230; the <strong>PROMPT</strong> command ! By default the prompt is set to the current path, but you can customize it a little.</p>
<blockquote><p># Display prompt help</p>
<p>PROMPT /?</p>
<p># Customize your prompt</p>
<p>PROMPT $T $D$_$P $F</p>
<p># Will give this result in my cmd window</p>
<p>17:11:55,31 sam. 21/10/2006</p>
<p>D:\Documents and Settings\Nicolas></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.shell-tips.com/2006/10/21/personnalize-your-doscmd-prompt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CLI workaround for Windows XP : Using LIST (LESS-Like)</title>
		<link>http://www.shell-tips.com/2006/10/21/cli-workaround-for-windows-xp-using-list-less-like/</link>
		<comments>http://www.shell-tips.com/2006/10/21/cli-workaround-for-windows-xp-using-list-less-like/#comments</comments>
		<pubDate>Sat, 21 Oct 2006 14:52:26 +0000</pubDate>
		<dc:creator>Nicolas Brousse</dc:creator>
				<category><![CDATA[DOS - Windows Batch Files]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.shell-tips.com/2006/10/21/cli-workaround-for-windows-xp-using-list-less-like/</guid>
		<description><![CDATA[In our list of &#8220;CLI workaround for Windows XP&#8220;, a missing command is LESS. Now, you can have a LESS-Like command with the DOS command LIST. Get the Windows Server 2003 Resource Kit tools on microsoft.com. While not 100% functionally-equivalent to most versions of the UNIX LESS command, list does support text searching and bi-directional [...]]]></description>
			<content:encoded><![CDATA[<p>In our list of &#8220;<strong>CLI workaround for Windows XP</strong>&#8220;, a missing command is <strong>LESS</strong>. Now, you can have a LESS-Like command with the DOS command <strong>LIST</strong>. Get the <a title="Windows Server 2003 Resource Kit tools" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&#038;DisplayLang=en"><strong>Windows Server 2003 Resource Kit tools</strong></a> on microsoft.com. <font class="bodytext">While not 100% functionally-equivalent to most versions of the UNIX <strong>LESS</strong> command, <span class="dos">list</span> does support text searching and bi-directional scrolling. This command is useful when examining log files (such as web server logs), configuration files, and software &#8220;read me&#8221; files when you don&#8217;t want to open a Notepad window. </font></p>
<blockquote><p><font class="bodytext"># Usage</font><br />
<font class="bodytext"><strong><br />
filename</strong><br />
<em>REQUIRED</em> &#8211; The filename you wish to view</font></p>
<p><font class="bodytext"><strong>-s:STRING</strong><br />
Performs a case insensitive search and highlights the first line matching your search text</font></p>
<p><font class="bodytext"><strong>-g:LINE#</strong><br />
The <span class="dos">list</span> display will jump to the specified line number, displaying it at the bottom of the screen. Note that <span class="dos">list</span> starts its line numbering from line 0.</font><font class="bodytext" /></p></blockquote>
<blockquote /><p><font class="bodytext"></font><font class="bodytext">While running the <span class="dos">list</span> command, here are a few of the functions you may perform:</font></p>
<blockquote><p><font class="bodytext"></font><font class="bodytext"><strong>Cursor keys</strong></font><br />
<font class="bodytext">Use the cursor keys to scroll through the file. If the file is too wide to view onscreen at once, the left and right cursor keys will be active.</font></p>
<p><font class="bodytext"></font><font class="bodytext"><strong>Page Up, Page Down Keys</strong></font><br />
<font class="bodytext">Scrolls through the text file up or down one page at a time</font></p>
<p><font class="bodytext"></font><font class="bodytext"><strong>Home, End Keys</strong></font><br />
<font class="bodytext">Jumps to the beginning or end of the file</font></p>
<p><font class="bodytext"></font><font class="bodytext"><strong>W</strong></font><br />
<font class="bodytext">Toggles text word-wrap</font></p>
<p><font class="bodytext"></font><font class="bodytext"><strong>Q or the ESC key</strong></font><br />
<font class="bodytext">Quit the <span class="dos">list</span> display</font></p>
<p><font class="bodytext"></font><font class="bodytext"><strong>/</strong></font><br />
<font class="bodytext">Perform a case-sensitive search of the string you specify</font></p>
<p><font class="bodytext"></font><font class="bodytext"><strong>\</strong></font><br />
<font class="bodytext">Perform a case-insensitive search of the string you specify</font></p>
<p><font class="bodytext"></font><font class="bodytext"><strong>n or F3</strong></font><br />
<font class="bodytext">Searches for the next match to the search string</font></p>
<p><font class="bodytext"></font><font class="bodytext"><strong>N</strong></font><br />
<font class="bodytext">Searches for the previous match to the search string</font></p>
<p><font class="bodytext"></font><font class="bodytext"><strong>G</strong></font><br />
<font class="bodytext">Jump to the specified line number</font></p>
<p><font class="bodytext"></font><font class="bodytext"><strong>F</strong></font><br />
<font class="bodytext">Open a new file without going back to the DOS prompt</font></p>
<p><font class="bodytext"></font><font class="bodytext"><strong>?</strong></font><br />
<font class="bodytext">Displays a full list of commands</font></p></blockquote>
<p><font class="bodytext"></font><font class="bodytext"><br />
Note that by entering more than one filename after the <span class="dos">list</span> command you can view more than one file. Although only one file is displayed at a time, the following commands switch between files specified on the command line:</font></p>
<blockquote><p><font class="bodytext"></font><font class="bodytext"><strong>CTRL PAGE-DOWN</strong></font><br />
<font class="bodytext">Displays the next file specified on the command line, or wraps to the first file.</font></p>
<p><font class="bodytext"></font><font class="bodytext"><strong>CTRL PAGE-UP</strong></font><br />
<font class="bodytext">Displays the previous file specified on the command line, or wraps to the last file.</font></p></blockquote>
<blockquote />
<h4><font class="bodytext">System Requirements</font></h4>
<div class="downloadInfo">
<ul><font class="bodytext"></p>
<li><strong>Supported Operating Systems: </strong>Windows Server 2003; Windows XP</li>
<p></font></ul>
<ul><font class="bodytext"></p>
<li>30 MB of free disk space</li>
<li>Windows XP</li>
<li>Windows XP SP1</li>
<li>Windows Server 2003 family</li>
<p></font></ul>
<p><font class="bodytext"><strong>Note: </strong>The Windows Server 2003 Resource Kit Tools are not supported on 64-bit platforms.</font></div>
]]></content:encoded>
			<wfw:commentRss>http://www.shell-tips.com/2006/10/21/cli-workaround-for-windows-xp-using-list-less-like/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
