<?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>Displayobject &#187; Windows</title>
	<atom:link href="http://www.displayobject.fr/category/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.displayobject.fr</link>
	<description>Back to the display list</description>
	<lastBuildDate>Mon, 09 Jan 2012 13:26:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Create cmd aliases in Windows</title>
		<link>http://www.displayobject.fr/2010/03/07/create-cmd-aliases-in-windows/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=create-cmd-aliases-in-windows</link>
		<comments>http://www.displayobject.fr/2010/03/07/create-cmd-aliases-in-windows/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 00:36:44 +0000</pubDate>
		<dc:creator>jonas</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.displayobject.fr/?p=342</guid>
		<description><![CDATA[While Linux has a simple command alias, this will require more work in windows. We will use the doskey command + wtf workaround... <a href="http://www.displayobject.fr/2010/03/07/create-cmd-aliases-in-windows/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>While Linux has a simple command alias, <span id="result_box"><span style="background-color: #ffffff;" title="cela va nécessiter plus de travail">this will require more work in</span></span> windows.<br />
We will firstly use the doskey command  :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">doskey ls=dir $*</pre></div></div>

<p>This command will create an alias ls that will execute the dir command.<br />
The variable $* allow us to pass all of the arguments entered after the alias.<br />
We can now use ls command instead of dir. Works very well, but alias won&#8217;t be saved when we quit <img src='http://www.displayobject.fr/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>We will now set multiple commands in an external file :</p>
<p><strong>cmd_aliases.txt</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ls=dir $*
ps=tasklist $*
clear=cls</pre></div></div>

<p>And execute :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">doskey /macrofile=c:\bin\cmd_aliases.txt</pre></div></div>

<p>Good, but we still loose our aliases when we quit.<br />
We&#8217;ll have to put this command in an autorun script called when cmd.exe launches.</p>
<p><strong>cmd_autorun.cmd</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">@echo off
cls
doskey /macrofile=c:\bin\cmd_aliases.txt</pre></div></div>

<p>And a last script to install our autorun in registry :</p>
<p><strong>cmd_autorun_install.cmd</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">reg add &quot;hkcu\software\microsoft\command processor&quot; /v Autorun /t reg_sz /d c:\bin\cmd_autorun.cmd</pre></div></div>

<p>Execute cmd_autorun_install.cmd (double click)</p>
<p>That&#8217;s ok !</p>
<p>Sources :</p>
<p>https://users.cs.jmu.edu/bernstdh/web/common/help/ntshell.php</p>
<p>http://superuser.com/questions/49170/create-an-alias-in-windows-xp/115259#115259</p>
]]></content:encoded>
			<wfw:commentRss>http://www.displayobject.fr/2010/03/07/create-cmd-aliases-in-windows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

