Saving application data in Windows XP when “Run As” is 'protecting the computer from unauthorized activity'

StackOverflow https://stackoverflow.com/questions/1170294

Question

I'm trying to make it so I can save data from my program when the user is running the applicaiton through run as like through this dialogue box. I'm finding I cant actually write to any folder and read back from it later on. i've tried 'All Users', Application data, My Documents, etc but to no avail.

Any ideas how and where I am supposed to save and read data when Windows XP is keeping my application from performing 'unauthorized activity'?

Was it helpful?

Solution

When the "protect" checkbox is checked, you can't really write anywhere (registry or filesystem) and that is sort of the point. Most programs don't even run with this option checked. Under the hood it uses the SAFER API. For more info, check this blog

OTHER TIPS

If you're not an administrator, you might not have the right to work with other users' folders. If you want to work with the folders that belong to the user who has launched your app, try using the APPDATA environment variable, which should hold the path of that user's application data folder. Environment variables are accessible via Win32 API or other methods, depending on your programming language.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top