Hi All,
Is there a way to access user's appdata folder and files in it using c# code.?
I have a code in c# which gets users appdata path from a running process and from that process I am getting the process's file name using process.MainModule.FileName call.
After killing that process, I am trying to remove that process's executable from the user's application data folder where the file remains. It works fine for XP from system user account, but on windows 7 it throws exception regarding 'Cannot access the file specified' with some I/O error in my c# code...
I know with Vista or later OSs, microsoft has enabled UAC that is why I am not able to users appdata folder directly. but I want to remove/delete one file from appdata path. Can I get this done with c# code on windows??
Please let me know any system tweaks which can achieve this programatically.
thanks in advance..
sanzee
Is there a way to access user's appdata folder and files in it using c# code.?
I have a code in c# which gets users appdata path from a running process and from that process I am getting the process's file name using process.MainModule.FileName call.
After killing that process, I am trying to remove that process's executable from the user's application data folder where the file remains. It works fine for XP from system user account, but on windows 7 it throws exception regarding 'Cannot access the file specified' with some I/O error in my c# code...
I know with Vista or later OSs, microsoft has enabled UAC that is why I am not able to users appdata folder directly. but I want to remove/delete one file from appdata path. Can I get this done with c# code on windows??
Please let me know any system tweaks which can achieve this programatically.
thanks in advance..
sanzee