windowscmddel

prevent DEL command from deleting a specific file


I'm a first semester student, searched everywhere with no luck, I have 2 questions in an assignment that are basically the same - or at least that's what I think.

First: You want to protect yourself from deleting with your DEL command your program named PROG.EXE. Specify some ways to do this.

Second: Write a command through which a file Pass.log could be protected by deleting with a command del Pass.log

Is there a way to protect them from DEL command within cmd?


Solution

  • On windows:

    On Unix/Linux: You can remove the write privilege from every one using chmod command. like chmod -w PROG.EXE

    For the second task: (on windows)