If you want a defined set of commands to run every time you start a command prompt, the best way to achieve that would be to specify an init script in the AutoRun registry value. Create it like this (an expandable string value allows you to use environment variables like %USERPROFILE%
):
reg add "HKCUSoftwareMicrosoftCommand Processor" /v AutoRun ^
/t REG_EXPAND_SZ /d "%"USERPROFILE"%init.cmd" /f
Then create a file init.cmd
in your profile folder:
@echo off
command_A
command_B
...
cls
To remove these changes, delete the registry key:
reg delete "HKCUSoftwareMicrosoftCommand Processor" /v AutoRun
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…