A .profile script for DOS shell
Posted: 28 Nov 2012 17:51
I created a .profile script for DOS shell. I wanted to share it:
Code: Select all
@ECHO OFF
ECHO Loading additional commands from:
ECHO %0
ECHO Type 'DOSKEY /MACROS:ALL' to see the configured commands.
:: to install, place this .bat script in the location you want
:: it to reside and then run this batch script with the argument "register"
IF "%1"=="register" (
REG.exe ADD "HKCU\Software\Microsoft\Command Processor\Autorun" /ve /t REG_SZ /d "%0" /f
ECHO The DOS profile is registered. Load a new command prompt and test a command.
)
@DOSKEY LS=DIR /w
@DOSKEY CP=COPY $*
@DOSKEY MV=MOVE $*
@DOSKEY H=DOSKEY /HISTORY
@DOSKEY WHERE=@for %%e in (%PATHEXT%) do @for %%i in ($*%%e) do @if NOT "%%~$PATH:i"=="" echo %%~$PATH:i