Usually, one does not have write permissions in C:\
.
Start the app as a privileged user
One should not do that, as it is not intended by OS design. Changing permissions onC:\
, or the system drive respectively, is a no-go.Save into a sub-directory of
System.getProperty("user.home");
(way to go)
The user home could also be a network folder with nighly backup in a domain network, for example. Especially for remote sessions (RDP, Citrix), this is often the case.
If you absolutely need to install a static file outside of the users folders, do it once, with an installer, configured to raise privileges (UAC).