Forum Discussion
dyckwal
Mar 05, 2025Copper Contributor
changing file attribute/metadata
Hello all, when I run a script that gives all of the file properties, I can see one named 'protected' and the value is 'yes'? Now I want this changed to 'No'. I am new to powershell and have been s...
LainRobertson
Mar 06, 2025Silver Contributor
Hi dyckwal,
PowerShell has a built-in commandlet that will do this for you:
Example
Unblock-File -Path "D:\Data\Forum\forum.pdf";
You can easily chain this onto other statements like Get-ChildItem to clear the zone association from multiple files.
Cheers,
Lain
dyckwal
Mar 06, 2025Copper Contributor
Hello Lian,
I executed this line:
Unblock-File -Path "D:\Walter\Pictures\Safari Fotos Februari 2025\Music List\2-02 Baby Elephant Walk.m4a";
but the outcome is that the Protected value is still Yes
So, it does not do what is expected. Is there code to change that specific field?
this is driving me up the wall 🤔