Run commands automatically at command prompt start
28 February 2003 by Snakefoot | Comment » | Trackback OffWhen opening a command prompt (cmd.exe) console, then it checks the following STRING values in the registry to see if any commands should be executed:
Note to specify several commands separate them with &&, or use a batch file like a Autoexec.bat.
Note the cmd has a switch to disable the execution of the Autorun:
Note the commands above will change the command prompt and color and change the default path/directory when opening the command prompt to the root of the C-drive.[HKEY_CURRENT_USER \SOFTWARE \Microsoft \Command Processor]
[HKEY_LOCAL_MACHINE \SOFTWARE \Microsoft \Command Processor]
Autorun = "prompt [%computername%]$S$P$G && COLOR 0A && CD C:\"
Note to specify several commands separate them with &&, or use a batch file like a Autoexec.bat.
Note the cmd has a switch to disable the execution of the Autorun:
Credits jsifaq.comcmd /d
Tags:
Category:
Updated: 23 September 2007
Comment by Adi - 18 February 2009 @ 2:34 Reply
As useful as this is, it screwed up my build system and it took me a LOT of time to figure that this was the culprit.
If your build systems spawn off new cmd’s internally to execute any processes, and God forbid if they use relative paths, changing your default root screws things up.