Community
    • Login

    batch scripts now open in npp instead of running.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 404 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cobaltcoyoteC
      cobaltcoyote
      last edited by

      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?

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • Vin dickatorV
        Vin dickator
        last edited by

        Try this,

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

        Goto

        Computer\HKEY_CLASSES_ROOT\batfile\shell\open\command
        

        Change “default” key to

        "%1" %*
        
        1 Reply Last reply Reply Quote 1
        • PeterJonesP
          PeterJones @cobaltcoyote
          last edited by

          @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.

          Vin dickatorV 1 Reply Last reply Reply Quote 3
          • Vin dickatorV
            Vin dickator @PeterJones
            last edited by Vin dickator

            @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…

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors