<p>To add to josh’s answer,</p>
<p>you may make the alias(es) <em>persistent</em> with the following steps,</p>
<ul>
<li></li>
</ul>
<p>Create a .bat or .cmd file with your <code>DOSKEY</code> commands.</p>
<ul>
<li></li>
</ul>
<p>Run regedit and go to <code>HKEY_CURRENT_USER\Software\Microsoft\Command Processor</code></p>
<ul>
<li></li>
</ul>
<p>Add String Value entry with the name <code>AutoRun</code> and the <em>full</em> path of your .bat/.cmd file.</p>
<p>Par exemple, <code>%USERPROFILE%\alias.cmd</code>, replacing the initial segment of the path with <code>%USERPROFILE%</code> is useful for syncing among multiple machines.</p>
<p>This way, every time cmd is run, the aliases are loaded.</p>
<p><strong>For Windows 10 or Windows 11</strong>, add the entry to <code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor</code> instead.</p>
<p>(For Windows 11, also notez que par défaut the “Terminal App” points to PowerShell. Search “cmd” for invite de commandes.)</p>
<p>For completeness, here is a template to illustrate the kind of aliases one may find useful.</p>
<pre><code class="lang-auto">@echo off
:: Temporary system path at cmd startup
set PATH=%PATH%;"C:\Program Files\Sublime Text 2\"
:: Add to path by command
DOSKEY add_python26=set PATH=%PATH%;"C:\Python26\"
DOSKEY add_python33=set PATH=%PATH%;"C:\Python33\"
:: Commands
DOSKEY ls=dir /B $*
DOSKEY sublime=sublime_text $*
::sublime_text.exe is name of the executable. By adding a temporary entry to system path, we don't have to write the whole directory anymore.
DOSKEY gsp="C:\Program Files (x86)\Sketchpad5\GSP505en.exe"
DOSKEY alias=notepad %USERPROFILE%\Dropbox\alias.cmd
:: Common directories
DOSKEY dropbox=cd "%USERPROFILE%\Dropbox\$*"
DOSKEY research=cd %USERPROFILE%\Dropbox\Research\
</code></pre>
<ul>
<li>
<p>Notez que the <code>$*</code> syntax works after a directory string as well as an executable which takes in arguments. So in the above example, the user-defined command <code>dropbox research</code> points to the same directory as <code>research</code>.</p>
</li>
<li>
<p>As Rivenfall pointed out, it is a good idea to include a command that allows for convenient editing of the <code>alias.cmd</code> file. See <code>alias</code> above. If you are in a cmd session, enter <code>cmd</code> to restart cmd and reload the</p>
</li>
</ul>
<p><em>(Réponse tronquée)</em></p>