I have looked for this a lot already and every answer is about Vim in Linux. Is there a way to save a read-only file right from Vim in Windows?
How do I save a read-only file in Vim for Windows?
microsoft windows;save
As on other vi/vim versions, you can use :w! to force the write, as long as you have permissions to override the read-only property.For example, if you have set the file as read-only, the above will work.  If Windows itself or an administrator has set it read-only, you will need another option.As @dash-tom-bang commented, one good example is within Program Files, where files are protected by default. This Microsoft knowledgebase article explains how that works in practice.