0

Every time I try to open some of my own .BAT files in Notepad++ (just to edit it, not to even run the batch file), I get the "Windows protected your PC" ... "prevented an unrecognized app from starting".

Protected your PC

(This happens when I right-click "Edit" on the .BAT file in File Explorer. I have setup the registry to associate ".bat" and the action "Edit" with Notepad++.)

I can edit them OK if I click "More info>Run anyway", but I don't want to have to do this at all on my own files.

Clearly I have something configured wrong, but what?

Here's an example of a file it happens on:

General Security Details

I'm user "Dave", and I have admin privs.

As a developer I should be able to at least edit text files with NP++ without getting this popup all the time. And run/test my own code.

But I don't want to disable Windows Defender generally (I do worry about attacks), or have to setup a special config for every single build of every app I work on.

How?

===========

Added in response to comments:

This only happens the FIRST time I try to open the .BAT with Right-Click "Edit".

I'm creating the batch file by copying and renaming an existing batch file (that opens OK, but which had the same behavior when first created the same way).

If, after creating the file that way (copy), I do RightClick "Edit", I get the UAC pop-up. I will get that each time I try to edit that way, until I do More Info>Run anyway. After that, it opens without a popup.

If, after creating the file that way (copy), I do RightClick "Edit with Notepad++", I don't get the UAC pop-up (but still will if I try "Edit").

If I check the "Unblock" box in Properties, then it opens OK either way, without the popup.

7
  • "I don't want to (...) setup a special config for every single build of every app I work on" but perhaps you should? Oct 12, 2022 at 18:10
  • Something is certainly wrong. I myself do what you are doing every single day with no such restriction. I myself didn't mess with the association. I use the "Edit with notepad++" option the installer added. I doubt that is the problem.. I have added 100 other custom associations and don't get the warning. Is .BAT still in your PATHEXT environment? What happens if it is a .CMD file? What happens if you use the same context item I do "Edit with notepad++"? Oct 12, 2022 at 18:15
  • What happens if you check this and click apply? i.stack.imgur.com/23MAR.png
    – Mokubai
    Oct 12, 2022 at 18:16
  • Please see additional details I just added (at the end of the question). Oct 12, 2022 at 18:26
  • @SeñorCMasMas Yes, .BAT is still in PATHEXT. Same thing happens with .CMD files. Oct 12, 2022 at 18:33

0

You must log in to answer this question.

Browse other questions tagged .