<?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>plasmid.co.uk &#187; autorun</title>
	<atom:link href="http://plasmid.co.uk/tag/autorun/feed/" rel="self" type="application/rss+xml" />
	<link>http://plasmid.co.uk</link>
	<description>because life is faster in reverse ...</description>
	<lastBuildDate>Thu, 20 May 2010 23:07:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
  <link>http://plasmid.co.uk</link>
  <url>http://plasmid.co.uk/wp/favicon.ico</url>
  <title>plasmid.co.uk</title>
</image>
		<item>
		<title>Emulating *nix Shell with Windows Command Prompt</title>
		<link>http://plasmid.co.uk/2009/12/03/emulating-nix-shell-with-windows-command-prompt/</link>
		<comments>http://plasmid.co.uk/2009/12/03/emulating-nix-shell-with-windows-command-prompt/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 23:04:36 +0000</pubDate>
		<dc:creator>plasmid</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[auto-complete]]></category>
		<category><![CDATA[autorun]]></category>
		<category><![CDATA[cmd]]></category>
		<category><![CDATA[CoreUtils]]></category>
		<category><![CDATA[doskey]]></category>
		<category><![CDATA[GnuWin32]]></category>
		<category><![CDATA[nix]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://plasmid.co.uk/?p=202</guid>
		<description><![CDATA[Ever tried to ls or rm under Windows?
With just a few minor adjustments the Windows Command Prompt (cmd.exe) can emulate the behaviour of your favourite *nix shell. Please note, this isn't a full emulation method - the existing Windows commands are being manipulated to appear as their *nix shell counterparts.
Note: This is for systems where [...]]]></description>
			<content:encoded><![CDATA[<p>Ever tried to <strong>ls</strong> or <strong>rm</strong> under Windows?</p>
<p>With just a few minor adjustments the Windows Command Prompt (cmd.exe) can emulate the behaviour of your favourite *nix shell. Please note, this isn't a full emulation method - the existing Windows commands are being manipulated to appear as their *nix shell counterparts.</p>
<p><ins datetime="2010-05-20T23:02:03+00:00">Note: This is for systems where unauthorized software is not permitted. If you administrate your own system, I highly recommend checking the <a href="http://gnuwin32.sourceforge.net/">GnuWin32</a>, in particular the <a href="http://gnuwin32.sourceforge.net/packages/coreutils.htm">CoreUtils package</a>.</ins><br />
<span id="more-202"></span><br />
<strong>Background</strong></p>
<p>This method involves simple implementation of the <a href="http://en.wikipedia.org/wiki/DOSKey">doskey macro utility</a>. For convenience, a Windows batch file (*.bat) will be used to wrap calls to doskey. Some small adjustments to the registry are necessary, so it is <strong>strongly advised that the registry is backed up</strong> before reading further.</p>
<p><strong>Create a Command List Batch File</strong></p>
<ol>
<li>Open a text editor of your choice (e.g. notepad).</li>
<li>The following are some examples of how to add a *nix command, with the Windows Command Prompt equivalent:<br />
<code>@ECHO OFF<br />
doskey sudo=runas /user:administrator $*<br />
doskey alias=doskey $*<br />
doskey ls=dir $*<br />
doskey rm=del $*<br />
doskey cp=copy $*<br />
doskey mv=move $*<br />
doskey clear=cls<br />
doskey reboot=echo The system is going down for reboot NOW!$T shutdown -r<br />
doskey restart=reboot<br />
doskey top=tasklist<br />
doskey traceroute=tracert $*<br />
doskey kill=taskkill /F /IM $*<br />
echo [%USERNAME%@%COMPUTERNAME%]$ *nix commands added<br />
</code></li>
<li>Save as a batch file somewhere on your system, <strong>e.g. C:\nix-cmd.bat</strong></li>
</ol>
<p>Please note: Not all commands will behave exactly like their counterpart, however these are some examples from my batch file.</p>
<p><strong>Enabling Batch File and Tab-key Auto-complete</strong></p>
<ol>
<li>Start->Run->regedit</li>
<li>To add auto-complete for...<br />
		... <strong>just your username</strong>:<br /><em>HKEY_CURRENT_USER\Software\Microsoft\Command Processor</em><br />
		... <strong>all system users</strong>:<br /><em>HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor</em>
	</li>
<li>Modify the key entries to reflect your system settings, although they should appear somewhat similar to the below:<br />
<div id="attachment_211" class="wp-caption aligncenter" style="width: 310px"><a href="http://plasmid.co.uk/wp/wp-content/uploads/2009/12/nix-cmd_registry.png"><img src="http://plasmid.co.uk/wp/wp-content/uploads/2009/12/nix-cmd_registry-300x71.png" alt="*nix cmd registry screen capture" title="nix-cmd_registry" width="300" height="71" class="size-medium wp-image-211" /></a><p class="wp-caption-text">*nix cmd registry screen capture</p></div></li>
</ol>
<p>If you want to use a different key for auto-complete (i.e. not tab), then change the CompletionChar and PathCompletionChar values to the desired hexadecimal character code.</p>
<p><strong>Footnote</strong></p>
<p>That is all there is to it! I mostly make do with the commands above - its just a nice little tweak to make the command prompt a bit more usable.</p>
]]></content:encoded>
			<wfw:commentRss>http://plasmid.co.uk/2009/12/03/emulating-nix-shell-with-windows-command-prompt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.185 seconds -->
