Help with PowerShell, changing from read-only

Ian Hook 1 Reputation point
2021-09-02T07:46:36.537+00:00

I've tried pretty much everything I could find about fixing the Windows 10 "read-only" reversion issue. I've had no luck. I decided to just try it through PowerShell. So I looked up the command, put in the command and then got this message:

"PS C:\Windows\system32> attrib -r +s C:\Program Files\Common Files\VST3\Spit.Perc
Parameter format not correct -"

Then I put help in and got this:

"PS C:\Windows\system32> HELP attrib -r +s C:\Program Files\Common Files\VST3\Spit.Perc
help : A positional parameter cannot be found that accepts argument 'C:\Program'.
At line:1 char:1

  • HELP attrib -r +s C:\Program Files\Common Files\VST3\Spit.Perc
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : InvalidArgument: (:) [help], ParameterBindingException
  • FullyQualifiedErrorId : PositionalParameterNotFound,help"

I tried it without spaces and got this:

"PS C:\Windows\system32> attrib -r +s C:\ProgramFiles\CommonFiles\VST3\Spit.Perc
Path not found - C:\ProgramFiles\CommonFiles\VST3"

and then this:

"PS C:\Windows\system32> HELP attrib -r +s C:\ProgramFiles\CommonFiles\VST3\Spit.Perc
help : A positional parameter cannot be found that accepts argument 'C:\ProgramFiles\CommonFiles\VST3\Spit.Perc'.
At line:1 char:1

  • HELP attrib -r +s C:\ProgramFiles\CommonFiles\VST3\Spit.Perc
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : InvalidArgument: (:) [help], ParameterBindingException
  • FullyQualifiedErrorId : PositionalParameterNotFound,help"

Thanks in Advance,

Ian Hook

Running Win10, 64bit

Windows for business | Windows Client for IT Pros | Devices and deployment | Configure application groups
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. MotoX80 37,156 Reputation points
    2021-09-02T12:22:31.783+00:00

    You have to put quotes around the folder name since it has a space in it. That is true for both Powershell and a command prompt.

    attrib -r +s "C:\Program Files\Common Files\VST3\Spit.Perc"
    

    Having said that, what is the real problem that you are trying to solve? Windows is not going to arbitrarily set a file/folder to read only just to annoy users. For "Program Files" folders, the Windows Installer is going to try to maintain the folder permissions that were defined by the software developer when they built the .MSI to install the software. Normally you would need to modify the NTFS permissions and not a file/folder attribute in order to enable update. You really shouldn't need to touch "Program Files" because your data files should be in C:\ProgramData or C:\Users\YourID\somewhere.

    Again, I would recommend that you explain the problem that you are trying to solve because I don't think that running attrib is the correct solution.


  2. MotoX80 37,156 Reputation points
    2021-09-02T13:27:01.367+00:00

    Putting quotations didn't give me an error prompt but also didn't fix the "read-only" issue.

    Like I said: Normally you would need to modify the NTFS permissions and not a file/folder attribute in order to enable update.

    Right click the folder and select Properties. Example:

    128667-capture.jpg


  3. MotoX80 37,156 Reputation points
    2021-09-02T14:32:24.323+00:00

    Is this what you are looking at? Note the "I just created this file.txt".

    128680-capture.jpg

    Ignore that and set the permissions. Then try to copy your files to the folder.

    128754-capture1.jpg


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.