Aliases in Windows command prompt

后端 未结 16 2719
故里飘歌
故里飘歌 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条回答
  •  旧时难觅i
    2020-11-22 11:25

    Given that you added notepad++.exe to your PATH variable, it's extra simple. Create a file in your System32 folder called np.bat with the following code:

    @echo off
    call notepad++.exe %*
    

    The %* passes along all arguments you give the np command to the notepad++.exe command.

    EDIT: You will need admin access to save files to the System32 folder, which was a bit wonky for me. I just created the file somewhere else and moved it to System32 manually.

提交回复
热议问题