24
11
Is there a way to lock a file with on-board tools so it can't be deleted or overwritten?
For testing of copy scripts I need to lock files temporarily
to check the error handling in the scripts. Till XP I used loading a file in debug.exe to lock it.
Is there a way in Windows 7 (and later)?
Edit
I know that there are programs doing this. My question is if there is a built in mechanism in windows. Sometimes I have to check a script on a PC and don't want to install new programs for that.
Edit2
Here are also good suggestions: How to purposefully exclusively lock a file?, which, however, need 3rd party tools or change the file to be locked.
Does the notepad trick work for you?
– nixda – 2014-12-28T17:02:26.6871@nixda No. It overwrites the file. I need to lock a present file without changing it. – marsh-wiggle – 2014-12-28T17:08:44.103
I see. I retract my close vote – nixda – 2014-12-28T17:14:15.733