I have an executable file in my system32 that I want to remove on startup using a service that I have written.
The service that's attempting the deletion is running under Local System account. The Executable file the service is trying to delete has "Full control" permissions assigned to SYSTEM and Administrators yet the service still fails to delete the file. I should add that the executable isn't running at the time the service trys to delete it. I have also tried to run the service under local service and network service accounts with the same problem.
Any suggestions advice as to what I may be doing wrong or things I can try would be very much appreciated.
I should add that I am able to delete the executable using windows explorer without running it as administrator.
when I run a batchfile as administrator to delete the executable , it deletes successfully but it does have to be run as administrator or I get access denied error.