I'd like my program to throw an error when it tries to create files in protected locations like the root of the C:\ drive (eg: FILE* FileHandle = fopen("\\file.txt", a)
). Instead the file gets created in the Virtual Store under %APPDATA%.
How can I disable that Virtual Store?
Thanks
EDIT: Just to be clear, I'm not asking how to circumvent the security and create my file in a protected location. I want the file creation to FAIL so that I can tell the user he was an idiot.
You add an application manifest. Choose asInvoker, highestAvailable, or requireAdministrator. It sounds like you want asInvoker.
From http://msdn.microsoft.com/en-us/library/bb756929.aspx: