Windows – Prevent a program from deleting files in Windows

windows

I have an executable program (no source code) that creates temporary files in a certain folder then deletes them at the end. I am having trouble with the program and would like to examine the temporary files to see if there's anything I can do without changing the source.

Is there a way I can prevent the program from deleting files, or alternatively prevent all programs from deleting files in a certain folder?

Best Answer

You can change the ACL on the folder in question so that the account running the executable (most likely you) can create, write, edit files in there, but not delete. Two issues:

  1. You would of course possibly cause the program to crash

  2. You will have to regain control of the folder afterwards (take ownership, reset all permissions etc) to be able to delete the files

Related Topic