We are rewriting our app to make it Windows Vista/7 compliant. In order to do that, I need to delete all the previous data in the application directory under %PROGRAMFILES%. This definitely will not work in user mode, and also doesn't appear to work programmatically in admin mode. I am trying to use the following line of code:
File.Delete(filePath);
Is there a way to write code to delete files in both user and admin mode? Going forward we will store all data under the %ALLUSERSPROFILE% directory, but until then I need to write migration code to handle this for the user.