开发者

Why can't I launch notepad++ from the command line anymore?

开发者 https://www.devze.com 2022-12-12 02:04 出处:网络
I\'m teaching myself some Django tonight开发者_运维技巧 using the local dev package at instantdjango.com

I'm teaching myself some Django tonight开发者_运维技巧 using the local dev package at instantdjango.com

I made it through half the tutorial, building a basic map with points on it, then closed out of the console for a bit. I just fired it back up and now when I try to use notepad++ to edit files, console tells me it doesn't recognize the command. What happened?

When I as working through the first half, I was able to type: "notepad++ filename.ext" and I'd get a text editor that would pop up.

Now when I type that, it doesn't recognize the command.

How do I get back the ability to use the text editor and how did I lose it?


In a windows terminal, you can launch notepad++ with the following:

start notepad++ <filename>

Note that the filename is optional.


Most likely the directory in which the Notepad++ executable resides is not in your system's PATH. For information about fixing this please see How to set the path in Windows 2000 / Windows XP.


If you are using gitbash or cygwin, you can create an alias

alias np='start notepad++'

And use

np myfile.txt


This is what I have done, in this way you dont have to type notepad++ Create np.bat file with this set of commands

@echo off
start "" "C:\Program Files (x86)\Notepad++\notepad++.exe" %*

place np.bat file in c:\Windows

open the command prompt and type np or np myfile.txt and enter.


One way is to make a change to this registry key:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Notepad++.exe]

You can download a zipped .reg file from Donn Felker that lets you open a file with just an n shortcut.

I edited the .reg before running it and to make sure the path to Notepad++ is correct (e.g. C:\Program Files (x86)) and I also changed the shortcut to n instead of n.

Then double click to add to your registry.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号