Deleting an exe in code gives "Access To Path c:\'Myfolder\myfile.exe" is denied
Posted on 2006-05-23
I have an application that is supposed to autoupdated itself when it sees a file in a certain directory at the start of running the application.
The application, in order to update itself, runs a very small utility application that simply closes the original application, waits 10 seconds to ensure it is properly closed, deletes the original application exe file and then moves the replacement into place from a local folder, renaming properly as it does so, runs the updated application and then closes itself.
The application and updater as well as the files for update are set to not propagate permissions of the parent fiolder and full permission is given to everyone on the network.
Further testing has revealed that the code is failing on the delete line.