Home > PowerShell > PowerShell: Remove readonly attribute

PowerShell: Remove readonly attribute

To remove a file READONLY attribute from a file using powershell the following command does the job:

attrib -h -r -s drive:\<path>\<foldername>

* note:you need to first remove the hidden attributes otherwise you will recieve the following error: “Not resetting hidden file.”

To further extend, you can view file attributes using:

attrib drive:\<path>\<foldername>

and make the file readonly using:

attrib +r drive:\<path>\<foldername>

and make the file both hidden and readonly using

attrib +h +r drive:\<path>\<foldername>

Reference: http://support.microsoft.com/kb/326549

Advertisements
  1. December 3, 2010 at 11:28 am

    Keep it up

  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: