This is the effort to make a usable profile script for
cmd.exe, the Windows command prompt.
1: :::: profile.cmd - profile script for cmd.exe 2: :: Maintainer: Szymon 'Polemon' Bereziak <firstname.lastname@example.org> 3: :: Last change: 2012-12-22 4: :: URL: http://polemon.org 5: :: Version: 0.3 6: 7: :: config vars 8: set DIRCMD=/A /O 9: 10: :: additional variables 11: set DESKTOP=%USERPROFILE%\Desktop 12: set ~=%USERPROFILE% 13: 14: :: expanding PATH 15: set PATH=%PATH%;%ProgramFiles%\7-Zip\ 16: ::set PATH=%PATH%;%SystemDrive%\texlive\2011\bin\win32\ 17: set PATH=%PATH%;%SystemDrive%\Python27\ 18: set PATH=%PATH%;%SystemDrive%\Python27\Scripts\ 19: set PATH=%PATH%;%ProgramFiles%\GnuWin32\bin\ 20: set PATH=%PATH%;%ProgramFiles%\Notepad++\ 21: set PATH=%PATH%;C:\MinGW\bin 22: set PATH=%PATH%;C:\LLVM\bin 23: set PATH=%PATH%;"%USERPROFILE%\bin\" 24: 25: :: feature settings 26: doskey /MACROFILE="%USERPROFILE%\macros.lst" > NUL 27: ::prompt $E[33m%COMPUTERNAME%$S$E[42m$P$S$E[31m$$$S$E[m 28: prompt %COMPUTERNAME%$S$P$S$$$S 29: color 07 30: title Console 31: 32: @echo off 33: cls
The file expands
%PATH% for use with GnuWin32, Notepad++, 7-zip, as well as a private
\bin directory. It also sets the console to a more comfortable state.
The doskey macro file is
macros.lst which should be next to
1: l=ls -F $* 2: ll=ls -lhF $* 3: la=ls -AF $* 4: lla=ls -AlhF $* 5: t=tree /f 6: e=notepad++ $*
Both files are supposed to be placed in
I suggest making a shortcut to
cmd.exe with the following settings:
%ComSpec% /k "%USERPROFILE%\profile.cmd"
Here's an example:
I recommend increasing the buffer size to at least 2048 lines. This is a console, you want appropriate scrollback capabilities afterall…
\bin directory can be filled with stuff normaly used with aliases on other shells as well: I have this in
1: @xz.exe -d %*
Normally, I wouldn't make an extra file for just this single command, but given that there is no such functionality on
cmd.exe, I must do it that way.
In case someone has additional suggestions, please let me know.