0

So, I stumbled across a little problem, I can't seem to figure out. I have a NAS where I dump data on and a script to download files I need back to my PC. While doing so, it creates a folder for the file. After that, I run a different script that encodes the video files to save some space. However, for some reason, the files and folders keep getting a 'read-only' lock that prevents the source file to be deleted after compression. So I have to get into each individual folder and remove the read-only permission.

Is there some way to disable the read-only lock? The Owner if the Root folder is my personal account, with full access. Changing it to SYSTEM or Admin with full access doesn't change anything.

WorldTeacher
  • 93
  • 1
  • 10
  • 1
    are you sure that it is read-only ... and not "this is still in use"? – Lee_Dailey Jan 09 '21 at 09:44
  • when I click on Properties, the read-only is checked, so yes, it's read-only – WorldTeacher Jan 09 '21 at 20:33
  • i recommend you dig into your NAS setup. it may be a setting on that side that is the source of the R-O. ///// another possible source is the util you are using to copy the files. ///// beyond that, i am out of ideas. [*sigh ...*] – Lee_Dailey Jan 09 '21 at 23:38
  • The read only attribute will not stop you from deleting the files. The read only attribute prevents the file from being edited. I would have to see a code sample to be sure, but I think you may have a line of code that is locking the file. Are you using the New-Object commandlet? – Aaron Jan 10 '21 at 00:53

0 Answers0