title: Setting folder permissions using NSIS
body: <p>I am attempting to set an open folder permission (i.e. Everyone has Full Access) using NSIS with RunAsW plugin that calls cscript.exe in an elevated user permissions.</p>
  
  <p>As follows:</p>
  
  <pre><code>Function ReplaceEXE
  
  ClearErrors
  
  SetOutPath '$TEMP'
  File 'RunAs.dll'
  
  File 'C:\WINDOWS\system32\cscript.exe'
  
  StrCpy $1 "adminaccount"
  StrCpy $2 "!adminpassword"
  StrCpy $3 '"$TEMP\C:\WINDOWS\system32\cscript.exe" //Nologo XCACLS.vbs    "C:\OpenAccessFolder" /F /T /E /G Everyone:M'
  StrCpy $4 0
  
  System::Call 'RunAs::RunAsW(w r1,w r2,w r3,*w .r4) i .r0 ? u'
  
  DetailPrint "Permissions have been edited correctly"
  DetailPrint "End installation"
  
  FunctionEnd
  </code></pre>