views:

178

answers:

2

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'?

+1  A: 

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.

eran
Even if you are admin, launching a process with that option on, the resulting process would have a deny SID for the admin group in the process token (Meaning, for access checks, you are NOT admin)
Anders
+1  A: 

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

Anders