powershellpowershell-1.0scripting

How to Remove ReadOnly Attribute on File Using PowerShell?


How can I remove the ReadOnly attribute on a file, using a PowerShell (version 1.0) script?


Solution

  • You can use Set-ItemProperty:

    Set-ItemProperty file.txt -name IsReadOnly -value $false
    

    or shorter:

    sp file.txt IsReadOnly $false