我希望每次启动 Windows CMD 时都会运行某个命令。
在 Ubuntu 或 Centos 等 Nix 系统中,我只需将所需的命令添加到 /etc/bash.bashrc 或 /home/USERNAME/.bashrc...
Windows 中是否有 bashrc 替代品?
我很想编辑这个文件并在其中添加我想要的命令,以便在每次引导 CMD 时,它将首先运行!
答案1
从cmd /?
:
If /D was NOT specified on the command line, then when CMD.EXE starts, it
looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if
either or both are present, they are executed first.
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun
and/or
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
答案2
你可以试试Cmder
。
/cmder/config/user-startup.cmd
相当于.bashrc
。