Probably Window Defender gone haywire, especially as a factory reset fixed the problem. Its a known problem with Defender that Microsoft can't or won't fix. The only permanent fix is to install another anti virus.