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".
(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:
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.




Microsoft Defender Smartscreen!=Windows Defenderthose two security features have little to do with one another. Smartscreen will block a file based on it's reputation, precisely, a lack of reputation. There are way to prevent this dialog, one of those ways, is to unblock the file. Smartscreen dialog will happen regardless of your permissions, so there isn't anything wrong, the correct action is to allow the application. The reason for the dialog likely has something to do with Notepadd++ or it's the Zone.Identifier – Ramhound Oct 12 '22 at 18:45