<?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>Skypher &#187; batch scripts</title>
	<atom:link href="http://skypher.com/index.php/category/languages/batch-scripts/feed/" rel="self" type="application/rss+xml" />
	<link>http://skypher.com</link>
	<description>The blog for absolutely nothing!</description>
	<lastBuildDate>Fri, 16 Jul 2010 08:26:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Delayed environment variable expansion and command extensions in CMD.EXE</title>
		<link>http://skypher.com/index.php/2009/09/17/delayed-environment-variable-expansion-and-command-extensions-in-cmd-exe/</link>
		<comments>http://skypher.com/index.php/2009/09/17/delayed-environment-variable-expansion-and-command-extensions-in-cmd-exe/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 16:01:16 +0000</pubDate>
		<dc:creator>SkyLined</dc:creator>
				<category><![CDATA[batch scripts]]></category>

		<guid isPermaLink="false">http://skypher.com/?p=201</guid>
		<description><![CDATA[<p>If you want to use delayed environment variable expansion and command extensions in a batch script, here&#8217;s a batch script that functions as a useful cheat sheet for setting, detecting and using them:</p>
<p>@ECHO OFF
IF &#8220;%1&#8243; == &#8220;TEST_EOF&#8221; (
  GOTO :EOF
) ELSE IF &#8220;%1&#8243; == &#8220;TEST_EXPANSION&#8221; (
  SET extensions=enabled
  IF &#8220;!extensions!&#8221;==&#8221;enabled&#8221; (
    ECHO  Delayed environment variable expansion = ON
  ) ELSE (
    ECHO  Delayed environment variable expansion = OFF
  )
) ELSE IF &#8220;%1&#8243; == &#8220;TEST_EXTENSIONS&#8221; (
  :: CALL :label is not available if test extensions are disabled...]]></description>
			<content:encoded><![CDATA[<p>If you want to use delayed environment variable expansion and command extensions in a batch script, here&#8217;s a batch script that functions as a useful cheat sheet for setting, detecting and using them:</p>
<p><CODE>@ECHO OFF<br />
IF &#8220;%1&#8243; == &#8220;TEST_EOF&#8221; (<br />
  GOTO :EOF<br />
) ELSE IF &#8220;%1&#8243; == &#8220;TEST_EXPANSION&#8221; (<br />
  SET extensions=enabled<br />
  IF &#8220;!extensions!&#8221;==&#8221;enabled&#8221; (<br />
    ECHO  Delayed environment variable expansion = ON<br />
  ) ELSE (<br />
    ECHO  Delayed environment variable expansion = OFF<br />
  )<br />
) ELSE IF &#8220;%1&#8243; == &#8220;TEST_EXTENSIONS&#8221; (<br />
  :: CALL :label is not available if test extensions are disabled.<br />
  CALL %0 TEST_EOF 2>nul<br />
  IF NOT ERRORLEVEL 1 (<br />
    ECHO  Command extensions                     = ON<br />
  ) ELSE (<br />
    ECHO  Command extensions                     = OFF<br />
  )<br />
) ELSE (<br />
  ECHO == Default ==<br />
    CALL %0 TEST_EXPANSION<br />
    CALL %0 TEST_EXTENSIONS<br />
  ECHO.<br />
&nbsp;<br />
  ECHO == Enabled ==<br />
    SETLOCAL ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS<br />
    CALL %0 TEST_EXPANSION<br />
    CALL %0 TEST_EXTENSIONS<br />
    ENDLOCAL<br />
  ECHO.<br />
&nbsp;<br />
  ECHO == Disabled ==<br />
    SETLOCAL DISABLEDELAYEDEXPANSION DISABLEEXTENSIONS<br />
    CALL %0 TEST_EXPANSION<br />
    CALL %0 TEST_EXTENSIONS<br />
    ENDLOCAL<br />
)</CODE><br />
(download the script <A href="http://Skypher.com/SkyLined/download/cmd/cmd-env-ext-test.cmd">here</A>).</p>
<p>Here&#8217;s the output of a run on my machine:</p>
<p><CODE>== Default ==<br />
 Delayed environment variable expansion = OFF<br />
 Command extensions                     = ON<br />
&nbsp;<br />
== Enabled ==<br />
 Delayed environment variable expansion = ON<br />
 Command extensions                     = ON<br />
&nbsp;<br />
== Disabled ==<br />
 Delayed environment variable expansion = OFF<br />
 Command extensions                     = OFF<br />
</CODE></p>
]]></content:encoded>
			<wfw:commentRss>http://skypher.com/index.php/2009/09/17/delayed-environment-variable-expansion-and-command-extensions-in-cmd-exe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GNU which for Windows: which.cmd</title>
		<link>http://skypher.com/index.php/2009/09/07/gnu-which-for-windows-which-cmd/</link>
		<comments>http://skypher.com/index.php/2009/09/07/gnu-which-for-windows-which-cmd/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 09:15:15 +0000</pubDate>
		<dc:creator>SkyLined</dc:creator>
				<category><![CDATA[batch scripts]]></category>

		<guid isPermaLink="false">http://skypher.com/?p=181</guid>
		<description><![CDATA[<p>I&#8217;ve implemented <a href="http://savannah.gnu.org/projects/which">GNU which</a> as a batch script for Windows. GNU which is a utility that is used to find which executable (or alias or shell function) is executed when entered on the shell prompt...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve implemented <a href="http://savannah.gnu.org/projects/which">GNU which</a> as a batch script for Windows. GNU which is a utility that is used to find which executable (or alias or shell function) is executed when entered on the shell prompt. Which.cmd does a similar job for windows: it finds which application or script is executed when you execute a command. It works by going through the list of executable extension in the &#8220;%PATHEXT%&#8221; environment variable and then searches through the &#8220;<TT>%PATH%</TT>&#8221; environment variable for a file with the name you provide on the command line for each extension. When it finds a match, it is displayed, when it finds nothing, it reports an error.</p>
<p>Example:<br />
<CODE><br />
C:\>which explorer<br />
C:\Windows\explorer.exe<br />
&nbsp;<br />
C:\>which cmd.exe<br />
C:\Windows\System32\cmd.exe<br />
&nbsp;<br />
C:\>which nc<br />
C:\Tools\nc.exe<br />
&nbsp;<br />
C:\>which blablablabla<br />
&#8220;blablablabla&#8221; not found<br />
&nbsp;<br />
</CODE></p>
<p>You can download the batch script <a href="http://skypher.com/SkyLined/download/GNU%20which/which.cmd">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://skypher.com/index.php/2009/09/07/gnu-which-for-windows-which-cmd/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>BATCH &amp; Python Chimera code</title>
		<link>http://skypher.com/index.php/2009/02/19/batch-python-chimera-code/</link>
		<comments>http://skypher.com/index.php/2009/02/19/batch-python-chimera-code/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 15:12:09 +0000</pubDate>
		<dc:creator>SkyLined</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[batch scripts]]></category>
		<category><![CDATA[Chimera batch python]]></category>

		<guid isPermaLink="false">http://skypher.com/?p=107</guid>
		<description><![CDATA[<p>I&#8217;ve create an example of how to create a file that can be run both as a valid cmd.exe batch script as well as a valid Python script...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve create an example of how to create a file that can be run both as a valid cmd.exe batch script as well as a valid Python script. This would be useful if python.exe is available on a system but not set up to handle .py files: a .cmd file can be used to automatically find the python exe and run the script.</p>
<p>The example can be found <a href="http://skypher.com/wiki/index.php?title=Chimera_code">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://skypher.com/index.php/2009/02/19/batch-python-chimera-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fuzzing Opera browser: how to get rid of the &#8220;start-up dialog&#8221; after a crash</title>
		<link>http://skypher.com/index.php/2008/10/23/fuzzing-opera-browser-how-to-get-rid-of-the-start-up-dialog-after-a-crash/</link>
		<comments>http://skypher.com/index.php/2008/10/23/fuzzing-opera-browser-how-to-get-rid-of-the-start-up-dialog-after-a-crash/#comments</comments>
		<pubDate>Thu, 23 Oct 2008 15:50:19 +0000</pubDate>
		<dc:creator>SkyLined</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[batch scripts]]></category>
		<category><![CDATA[Opera Fuzzing Chimera]]></category>

		<guid isPermaLink="false">http://skypher.com/?p=61</guid>
		<description><![CDATA[<p>If you want to automate running Opera to run fuzzers, you&#8217;ll find that once you&#8217;ve crashed Opera, it does not start as normal the next time you run it...]]></description>
			<content:encoded><![CDATA[<p>If you want to automate running Opera to run fuzzers, you&#8217;ll find that once you&#8217;ve crashed Opera, it does not start as normal the next time you run it. Opera had provided a &#8220;<a title="Opera start-up dialog help" href="http://help.opera.com/Windows/9.60/en/dialogs.html#startup" target="_blank">start-up dialog</a>&#8221; for your convenience that shows up after you&#8217;ve crashed it. Also, Opera has a session restore feature that can cause problems when you start Opera using the command-line to open a URL; it will open the pages from the previous session as well. Unfortunately, I was unable to find configuration settings to disabled either one of these features. </p>
<p>To get around these problems I&#8217;ve created a program that will modify the &#8220;Opera.ini&#8221; file as well as delete the session folder. If you run this program, it will remove all traces of a crash that cause Opera to open the start-up dialog and restore the previous session. After running it, you can start Opera as usual.</p>
<p>On the off chance that you&#8217;ve encountered this problem, I&#8217;ve made the program available <a title="Download dirtyOperaHack.zip" href="http://skypher.com/SkyLined/download/Opera/dirtyOperaHack.zip" target="_self">here</a>. The program is called &#8220;dirtyOperaHack.cmd&#8221;. It is a <a title="Skypher wiki on Chimera files" href="http://skypher.com/wiki/index.php?title=Chimera_code#BATCH_script_.26_JavaScript" target="_blank">chimera file</a>; part JavaScript, part batch-file. I&#8217;ve also included the individual source files from which it was created for your convenience. You can run &#8220;make.cmd&#8221; to create &#8221;dirtyOperaHack.cmd&#8221; from the individual source files.</p>
<p><B>UPDATE</B><br />
Opera 10 seems to have changed the paths for some of these settings. I have an updated version of my &#8220;Dirty Opera Hack&#8221; script available <A href="http://skypher.com/SkyLined/download/Opera/dirtyOperaHack2.zip" target="_self">here</A>.</p>
]]></content:encoded>
			<wfw:commentRss>http://skypher.com/index.php/2008/10/23/fuzzing-opera-browser-how-to-get-rid-of-the-start-up-dialog-after-a-crash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
