I use File.Delete
to delete a .exe
file in the C drive. But it says I don't have access to delete it. Now I want to use File.Delete
and File.Move
to do it, I tried running VS with Admin rights but it didn't work.
I want to work with C drive, not another drive. Thank you
P/s: I tried the mentioned solutions with the same problem, but it didn't work for me.
File.Delete(@"C:\Program Files (x86)\ProgramName\FileName.exe");
File.Move(@"newFileName.exe", @"C:\Program Files (x86)\ProgramName\");