In my application I have some Save methods that store data on user’s hard disk. How could it be possible to prevent the user from getting access, change or delete that files as soon as the application can still access, change and delete that files?
The possible solution is running the application As Administrator on a limited user who don’t have access to the save folder but with a predefined Username and Password of the system administrator which stored in application.
I’ve read other topics to work with UAC, Application Manifest.
As I mentioned in Title Is it possible to run a program as administrator without user interaction?
EDIT 1: I’m looking for a solution that works on all version of windows(XP, Vista and Seven)
@HarryJohnston said in comments:
“To do what you’re asking for, write a launcher application that uses CreateProcessWithLogonW (with a known admin username and password) to start the real application. Be warned that a competent user will be able to extract the admin credentials and log on as the administrator. Ben’s answer (a split application) is the proper approach.”
And it’s my selected answer.