If you work in a corporate with tight security rules and u need to edit the local hosts file on your Windows machine you might end up the following error:
Save failed" - "Please check whether if this file is opened in another program"
Workaround: Open Notepad++ as Administrator (“Run as administrator”) then search for hosts file in C:\Windows\System32\drivers\etc and open it.
This should fix the issue temporary
Locked Windows hosts file