cmd
settings on windowsalias
Recently , I pnpm
feel that the input p,n,p,m
is not very accustomed to using it. So I set it up on my own windows.alias
Microsoft
The documents you consulted can be found doskey
, and you can use doskey
them to create common ones alias
.
bat file
First create a new .bat
file and write the required settings alias
.
starts doskey
with , then is alias
, followed by the actual command after the equals sign.
@REM $* 表示这个命令可能会有参数
@REM @doskey表示执行这个命令时,不显示这条命令本身
@REM pnpm相关
@doskey ls=dir /b $*
@doskey p=pnpm
复制代码
Add this bat file in the registry
win + R
Then enter regedit
into the registry, follow HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
this path to find
If you don't have AutoRun
this option, you can right-click Command Processor
and then create new --> string value --> input AutoRun
. Then right-click to modify the new one . Enter the path AutoRun
of the previously created file in the value data ..bat
Mine is to put the bat
file in the user directory. Then use the system variable directly %USERPROFILE%\fastkey.bat
.
If you feel that opening the registry is too troublesome, there is another way.
Create REG file
For example, create a file alias.reg
and enter the following.
AutoRun
The value is .bat
the path to the file.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
"AutoRun"="%USERPROFILE%\fastkey.bat"
复制代码
Then double-click to run the REG
file and it will be automatically added to the registry.
Finally open cmd to verify
Enter ls
the command. You will see dir
the same effect as.