<?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>MemoSoup &#187; Windows &amp; DOS</title>
	<atom:link href="http://www.memosoup.com/category/scripts/windows-scripts/feed" rel="self" type="application/rss+xml" />
	<link>http://www.memosoup.com</link>
	<description>Mix of the things I always forget</description>
	<lastBuildDate>Fri, 30 Jul 2010 15:59:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>WHICH command for DOS</title>
		<link>http://www.memosoup.com/20090921/which-command-for-dos.html</link>
		<comments>http://www.memosoup.com/20090921/which-command-for-dos.html#comments</comments>
		<pubDate>Mon, 21 Sep 2009 11:59:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[Windows & DOS]]></category>
		<category><![CDATA[dos]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[which]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=150</guid>
		<description><![CDATA[<p>If You need the analog of Unix &#8216;which&#8217; command and do not have Resource Kit, the following batch file will help.
The code was found on www.ss64.com
Published with the permission of the author, Clay Calvert.</p>
@echo off
SETLOCAL
&#40;set WF=&#41;

:: Look for file in the current directory

for %%a in &#40;&#34;&#34; %%&#41; do &#40;
if not defined WF if exist &#34;%~1%%~a&#34; set [...]]]></description>
			<content:encoded><![CDATA[<p>If You need the analog of Unix &#8216;which&#8217; command and do not have Resource Kit, the following batch file will help.<br />
The code was found on <a href="http://www.ss64.com/nt/which.txt">www.ss64.com</a><br />
Published with the permission of the author, Clay Calvert.</p>
<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #33cc33;">@</span><a href="http://www.ss64.com/nt/echo.html"><span style="color: #b1b100; font-weight: bold;">echo</span></a> off<br />
<a href="http://www.ss64.com/nt/setlocal.html"><span style="color: #b1b100; font-weight: bold;">SETLOCAL</span></a><br />
<span style="color: #66cc66;">&#40;</span><a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> WF=<span style="color: #66cc66;">&#41;</span><br />
<br />
:<span style="color: #b100b1; font-weight: bold;">: Look <a href="http://www.ss64.com/nt/for.html"><span style="color: #00b100; font-weight: bold;">for</span></a> file <a href="http://www.ss64.com/nt/in.html"><span style="color: #00b100; font-weight: bold;">in</span></a> the current directory</span><br />
<br />
<a href="http://www.ss64.com/nt/for.html"><span style="color: #00b100; font-weight: bold;">for</span></a> <span style="color: #33cc33;">%%</span><span style="color: #448888;">a</span> <a href="http://www.ss64.com/nt/in.html"><span style="color: #00b100; font-weight: bold;">in</span></a> <span style="color: #66cc66;">&#40;</span>&quot;&quot; <span style="color: #33cc33;">%</span><span style="color: #33cc33;">%</span><span style="color: #66cc66;">&#41;</span> <a href="http://www.ss64.com/nt/do.html"><span style="color: #00b100; font-weight: bold;">do</span></a> <span style="color: #66cc66;">&#40;</span><br />
<a href="http://www.ss64.com/nt/if.html"><span style="color: #00b100; font-weight: bold;">if</span></a> <a href="http://www.ss64.com/nt/not.html"><span style="color: #000000; font-weight: bold;">not</span></a> <a href="http://www.ss64.com/nt/defined.html"><span style="color: #000000; font-weight: bold;">defined</span></a> WF <a href="http://www.ss64.com/nt/if.html"><span style="color: #00b100; font-weight: bold;">if</span></a> <a href="http://www.ss64.com/nt/exist.html"><span style="color: #000000; font-weight: bold;">exist</span></a> &quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">~1</span><span style="color: #33cc33;">%%</span><span style="color: #448888;">~a</span>&quot; <a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> WF=<span style="color: #33cc33;">%</span><span style="color: #448888;">CD</span><span style="color: #33cc33;">%</span>\<span style="color: #33cc33;">%</span><span style="color: #448888;">~1</span><span style="color: #33cc33;">%%</span><span style="color: #448888;">~a</span><span style="color: #66cc66;">&#41;</span><br />
<br />
:<span style="color: #b100b1; font-weight: bold;">: Look <a href="http://www.ss64.com/nt/for.html"><span style="color: #00b100; font-weight: bold;">for</span></a> file <a href="http://www.ss64.com/nt/in.html"><span style="color: #00b100; font-weight: bold;">in</span></a> the PATH</span><br />
<br />
<a href="http://www.ss64.com/nt/for.html"><span style="color: #00b100; font-weight: bold;">for</span></a> <span style="color: #33cc33;">%%</span><span style="color: #448888;">a</span> <a href="http://www.ss64.com/nt/in.html"><span style="color: #00b100; font-weight: bold;">in</span></a> <span style="color: #66cc66;">&#40;</span>&quot;&quot; <span style="color: #33cc33;">%</span><span style="color: #33cc33;">%</span><span style="color: #66cc66;">&#41;</span> <a href="http://www.ss64.com/nt/do.html"><span style="color: #00b100; font-weight: bold;">do</span></a> <span style="color: #66cc66;">&#40;</span><br />
<a href="http://www.ss64.com/nt/if.html"><span style="color: #00b100; font-weight: bold;">if</span></a> <a href="http://www.ss64.com/nt/not.html"><span style="color: #000000; font-weight: bold;">not</span></a> <a href="http://www.ss64.com/nt/defined.html"><span style="color: #000000; font-weight: bold;">defined</span></a> WF <a href="http://www.ss64.com/nt/for.html"><span style="color: #00b100; font-weight: bold;">for</span></a> <span style="color: #33cc33;">%%</span><span style="color: #448888;">g</span> <a href="http://www.ss64.com/nt/in.html"><span style="color: #00b100; font-weight: bold;">in</span></a> <span style="color: #66cc66;">&#40;</span>&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">~1</span><span style="color: #33cc33;">%%</span><span style="color: #448888;">~a</span>&quot;<span style="color: #66cc66;">&#41;</span> <a href="http://www.ss64.com/nt/do.html"><span style="color: #00b100; font-weight: bold;">do</span></a> <span style="color: #66cc66;">&#40;</span><br />
<a href="http://www.ss64.com/nt/if.html"><span style="color: #00b100; font-weight: bold;">if</span></a> <a href="http://www.ss64.com/nt/exist.html"><span style="color: #000000; font-weight: bold;">exist</span></a> &quot;<span style="color: #33cc33;">%</span><span style="color: #33cc33;">%</span>~$PATH:g&quot; <a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> WF=<span style="color: #33cc33;">%</span><span style="color: #33cc33;">%</span>~$PATH:g<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><br />
<br />
:<span style="color: #b100b1; font-weight: bold;">: Store the Help Error message</span><br />
<br />
<a href="http://www.ss64.com/nt/if.html"><span style="color: #00b100; font-weight: bold;">if</span></a> <a href="http://www.ss64.com/nt/not.html"><span style="color: #000000; font-weight: bold;">NOT</span></a> &quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">~x1</span>&quot;==&quot;&quot; <a href="http://www.ss64.com/nt/goto.html"><span style="color: #00b100; font-weight: bold;">goto</span></a>:END<br />
<a href="http://www.ss64.com/nt/for.html"><span style="color: #00b100; font-weight: bold;">for</span></a> /f &quot;delims=.&quot; <span style="color: #33cc33;">%%</span><span style="color: #448888;">a</span> <a href="http://www.ss64.com/nt/in.html"><span style="color: #00b100; font-weight: bold;">in</span></a> <span style="color: #66cc66;">&#40;</span>'help.exe *'<span style="color: #66cc66;">&#41;</span> <a href="http://www.ss64.com/nt/do.html"><span style="color: #00b100; font-weight: bold;">do</span></a> <a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> HlpErr=<span style="color: #33cc33;">%%</span><span style="color: #448888;">a</span><br />
<br />
:<span style="color: #b100b1; font-weight: bold;">: <a href="http://www.ss64.com/nt/if.html"><span style="color: #00b100; font-weight: bold;">If</span></a> command missing from Help, <a href="http://www.ss64.com/nt/goto.html"><span style="color: #00b100; font-weight: bold;">goto</span></a> end</span><br />
<br />
help.exe &quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">~1</span>&quot; |find &quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">HlpErr</span><span style="color: #33cc33;">%</span>&quot;&amp;gt;<a href="http://www.ss64.com/nt/nul.html"><span style="color: #0000ff; font-weight: bold;">nul</span></a> &amp;amp;&amp;amp; <a href="http://www.ss64.com/nt/goto.html"><span style="color: #00b100; font-weight: bold;">goto</span></a>:END<br />
<br />
:<span style="color: #b100b1; font-weight: bold;">: Listed <a href="http://www.ss64.com/nt/in.html"><span style="color: #00b100; font-weight: bold;">in</span></a> help so find file <a href="http://www.ss64.com/nt/in.html"><span style="color: #00b100; font-weight: bold;">in</span></a> System32</span><br />
<br />
<a href="http://www.ss64.com/nt/for.html"><span style="color: #00b100; font-weight: bold;">for</span></a> <span style="color: #33cc33;">%%</span><span style="color: #448888;">a</span> <a href="http://www.ss64.com/nt/in.html"><span style="color: #00b100; font-weight: bold;">in</span></a> <span style="color: #66cc66;">&#40;</span>exe com<span style="color: #66cc66;">&#41;</span> <a href="http://www.ss64.com/nt/do.html"><span style="color: #00b100; font-weight: bold;">do</span></a> <span style="color: #66cc66;">&#40;</span><br />
<a href="http://www.ss64.com/nt/if.html"><span style="color: #00b100; font-weight: bold;">if</span></a> /i &quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">WF</span><span style="color: #33cc33;">%</span>&quot;==&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">windir</span><span style="color: #33cc33;">%</span>\system32\<span style="color: #33cc33;">%</span><span style="color: #448888;">~1</span>.<span style="color: #33cc33;">%%</span><span style="color: #448888;">a</span>&quot; <a href="http://www.ss64.com/nt/goto.html"><span style="color: #00b100; font-weight: bold;">goto</span></a>:END<span style="color: #66cc66;">&#41;</span><br />
<br />
:<span style="color: #b100b1; font-weight: bold;">: File <a href="http://www.ss64.com/nt/not.html"><span style="color: #000000; font-weight: bold;">not</span></a> <a href="http://www.ss64.com/nt/in.html"><span style="color: #00b100; font-weight: bold;">in</span></a> System32, so must be an internal command</span><br />
<br />
<a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> WF=&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">~1</span>&quot; is an internal command<br />
<br />
:<span style="color: #b100b1; font-weight: bold;">END</span><br />
<a href="http://www.ss64.com/nt/if.html"><span style="color: #00b100; font-weight: bold;">if</span></a> <a href="http://www.ss64.com/nt/defined.html"><span style="color: #000000; font-weight: bold;">defined</span></a> WF <span style="color: #66cc66;">&#40;</span><a href="http://www.ss64.com/nt/echo.html"><span style="color: #b1b100; font-weight: bold;">echo</span></a>.<span style="color: #33cc33;">%</span><span style="color: #448888;">WF</span><span style="color: #33cc33;">%</span><span style="color: #66cc66;">&#41;</span> <a href="http://www.ss64.com/nt/else.html"><span style="color: #00b100; font-weight: bold;">else</span></a> <span style="color: #66cc66;">&#40;</span><br />
<a href="http://www.ss64.com/nt/echo.html"><span style="color: #b1b100; font-weight: bold;">echo</span></a> The file: &quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">~1</span>&quot; was <a href="http://www.ss64.com/nt/not.html"><span style="color: #000000; font-weight: bold;">not</span></a> found<span style="color: #66cc66;">&#41;</span><br />
<br />
:<span style="color: #b100b1; font-weight: bold;">: Credits:</span><br />
:<span style="color: #b100b1; font-weight: bold;">: Clay Calvert</span><br />
:<span style="color: #b100b1; font-weight: bold;">: alt.msdos.batch.nt</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20090921/which-command-for-dos.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Start sqlplus in Windows .BAT script</title>
		<link>http://www.memosoup.com/20090825/start-sqlplus-in-windows-bat-script.html</link>
		<comments>http://www.memosoup.com/20090825/start-sqlplus-in-windows-bat-script.html#comments</comments>
		<pubDate>Mon, 24 Aug 2009 22:37:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Windows & DOS]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=19</guid>
		<description><![CDATA[<p>Here is the example of emulating &#8220;HERE-documents&#8221; in Windows shell.</p>
@ECHO OFF 

FIND &#34;/*%none% some_label&#34; &#60;%0 &#124;sqlplus USER/PASS@SERVER 

GOTO end 

: ----------- embedded SQL------------------------- 

/* some_label */ select count&#40;*&#41; from dba_free_space; 
/* some_label */ select tablespace_name from dba_tablespaces; 

: ----------- end of embedded SQL------------------------- 

:end
<p>It&#8217;s also possible to use procedures in .bat files.
%none% is replaced by empty [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the example of emulating <strong>&#8220;HERE-documents&#8221;</strong> in Windows shell.</p>
<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #33cc33;">@</span><a href="http://www.ss64.com/nt/echo.html"><span style="color: #b1b100; font-weight: bold;">ECHO</span></a> OFF <br />
<br />
FIND &quot;/*<span style="color: #33cc33;">%</span><span style="color: #448888;">none</span><span style="color: #33cc33;">%</span> some_label&quot; &lt;<span style="color: #33cc33;">%</span><span style="color: #448888;">0</span> |sqlplus USER/PASS<span style="color: #33cc33;">@</span>SERVER <br />
<br />
<a href="http://www.ss64.com/nt/goto.html"><span style="color: #00b100; font-weight: bold;">GOTO</span></a> end <br />
<br />
: <span style="color: #b100b1; font-weight: bold;">----------- embedded SQL------------------------- </span><br />
<br />
/* some_label */ select count<span style="color: #66cc66;">&#40;</span>*<span style="color: #66cc66;">&#41;</span> from dba_free_space; <br />
/* some_label */ select tablespace_name from dba_tablespaces; <br />
<br />
: <span style="color: #b100b1; font-weight: bold;">----------- end of embedded SQL------------------------- </span><br />
<br />
:<span style="color: #b100b1; font-weight: bold;">end</span></div></div>
<p>It&#8217;s also possible to use procedures in .bat files.<br />
%none% is replaced by empty string.<br />
Spaces are mandadory in &#8220;/* some_label */&#8221;  string.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20090825/start-sqlplus-in-windows-bat-script.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
