Run commands automatically at command prompt start
When 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:
[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 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.
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: