Aliases in Windows command prompt

后端 未结 16 2763
故里飘歌
故里飘歌 2020-11-22 10:47

I have added notepad++.exe to my Path in Environment variables.

Now in command prompt, notepad++.exe filename.txt opens the filename

16条回答
  •  眼角桃花
    2020-11-22 11:18

    Console Aliases in Windows 10

    To define a console alias, use Doskey.exe to create a macro, or use the AddConsoleAlias function.

    doskey

    doskey test=cd \a_very_long_path\test
    

    To also pass parameters add $* at the end: doskey short=longname $*

    AddConsoleAlias

    AddConsoleAlias( TEXT("test"), 
                     TEXT("cd \\\\test"), 
                     TEXT("cmd.exe"));
    

    More information here Console Aliases, Doskey, Parameters

提交回复
热议问题