![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | How to remove read-only property of a file? When removing a file in ps, if the file is read-only, the command will fail. Remove-Item c:\pstest\file1.txt Is there a way to remove the "read-only" property of a file? Thanks! |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: How to remove read-only property of a file? You can use the good old console program attrib.exe to change file properties. Run attrib /? to see how to use it. Remove-Item also has a -force parameter to delete read-only files. -- greetings dreeschkind "dh" wrote: > When removing a file in ps, if the file is read-only, the command will fail. > > Remove-Item c:\pstest\file1.txt > > Is there a way to remove the "read-only" property of a file? > > Thanks! |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: How to remove read-only property of a file? To view a file's attributes you can: (Get-Item c:\pstest\file1.txt).attributes ReadOnly, Archive To change a file's attributes you can assign them to, or remove them from, its attributes property: (Get-Item c:\pstest\file1.txt).attributes = 'Archive' Verify: (Get-Item c:\pstest\file1.txt).attributes Archive But if you just want to delete the ReadOnly file use Remove-Item's -force parameter, as dreeschkind suggested. -- Kiron |
My System Specs![]() |
| | #4 (permalink) |
| Guest | RE: How to remove read-only property of a file? This is what I have used (Get-Childitem c:\pstest\file1.txt).Set_IsReadOnly($false) "dh" wrote: > When removing a file in ps, if the file is read-only, the command will fail. > > Remove-Item c:\pstest\file1.txt > > Is there a way to remove the "read-only" property of a file? > > Thanks! |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: How to remove read-only property of a file? use -force parameter. "dh" <dh@discussions.microsoft.com> wrote: news:7FB2BC20-CA0D-4D29-9CB9-32F11DDF6C50@microsoft.com... > When removing a file in ps, if the file is read-only, the command will fail. > > Remove-Item c:\pstest\file1.txt > > Is there a way to remove the "read-only" property of a file? > > Thanks! |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Read-Only Checkbox in Folder Property window | Peter K | Vista General | 3 | 06-16-2008 01:46 PM |
| Remove Read Only on a file in System folder | Steve | Vista security | 1 | 06-15-2008 03:48 PM |
| Remove Member Property? | Brian Vallelunga | PowerShell | 4 | 09-09-2007 08:23 PM |
| Read-only property won't turn off | Michelle | Vista General | 2 | 07-06-2007 04:28 PM |
| Read zip files? Remove targeted file? | clintonG | PowerShell | 2 | 04-13-2007 04:40 PM |