How to hide a file in Windows?
How to set a read only file in Windows?
Or set a read only file in Windows and hide it.
Setting a file to read only or hiding a file in Windows, or doing both at the same time, can be done using Command Prompt or using PowerShell.
Example commands:
Hiding a file in Windows using PowerShell:
(Get-Item "C:\file_example.txt").Attributes = 'Hidden'
Setting a read-only file:
(Get-Item "C:\file_example.txt").Attributes = 'ReadOnly'
Set both read-only and hidden attributes to a file.
(Get-Item "C:\file_example.txt").Attributes = 'Hidden, ReadOnly'
How to reset the attributes or remove the attributes that was set?
(Get-Item "C:\file_example.txt").Attributes = 'Normal'
Hiding a file using command Prompt:
c:\attrib +h "file_example.txt"
Setting a read-only file:
c:\attrib +h "file_example.txt"
Set both read-only and hidden attributes to a file.
c:\attrib +h +r "file_example.txt"
How to reset the attributes or remove the attributes that was set?
c:\attrib -h -r "file_example.txt"
That's it..till next time...
Be thankful even in distress or adversities, for it is where you will know your strength.
"...And let us run with perseverance the race marked out for us, fixing our eyes on Jesus, the pioneer and perfecter of faith." — Hebrews 12:1-2
Comments
Post a Comment