batch scripts now open in npp instead of running.

  • What the title says. I’m using Win 10, and associated filetypes with NPP so I’d have “Edit with Notepad++” in the context menu. “Open with…” wasn’t appearing, and I assumed I’d be able to right click and use Run. Well, now Edit with NPP shows up, but I no longer have Run as an option, and double-clicking also opens the file in NPP. How can I make this work?

  • Try this,

    Open Registry Editor, (regedit in Run {Win+R})



    Change “default” key to

    "%1" %*

  • @cobaltcoyote asked a question almost a month ago:

    Hmm, I wonder how we missed that post originally. I know you haven’t been back, but sorry for not replying.

    My advice would have been similar to what I said here.

    @Vin-dickator ,

    I appreciate that you were trying to help. However, I don’t know whether that would really fix it. First, because that would just change it so the “edit in Notepad++” entry would go away, rather than allowing both to co-exist. Also, given the way that @cobaltcoyote changed the association, there’s a good chance it’s not even using the batfile entry in the registry anymore; Notepad++ possibly created a separate key, and redirected .bat to that key, rather than to the batfile. The OP would then need to first change Computer\HKEY_CLASSES_ROOT\.bat back to having a (Default) of batfile before that fix would work – and probably wouldn’t need that fix if the old batfile had been left unmodified.

    I would then suggest manually adding a new verb below Computer\HKEY_CLASSES_ROOT\batfile\shell, with key=Notepad++, subkey=command with (Default) set to "c:\program files\notepad++\notepad++.exe" "%1" %* (or just change the edit command from notepad.exe to the notepad++ command I just listed.)

    But the fundamental problem was the Open With bug originally described. And following my advice from the other post would help fix that underlying root cause, too.

  • @PeterJones I thought, they wanted Batch to run instead of opening it in Notepad++ directly (like the default functionality); guess I mis-understood their motives…

Log in to reply