"rm" and read-only

  • Andrew Robinson

    Andrew Robinson - 2004-08-19

    Trying to recursively delete files from a command-line (Using WinXP SP2). Using the command:

    rm -rf some_folder

    This will only work if the files are writable, it will throw permission denied errors if read-only. Since read-only in windows doesn't mean that you can't write, only that you shouldn't write, is there a way to override this so that rm will delete read-only files?

    If not, could you possibly include this as default behavior or as a command-line option to rm?


    • JJ Streicher-Bremer

      You can use the native NT command rd to remove the folders.  The command would look something like this:
      rd /s /q some_folder



Log in to post a comment.