I have a vbscript that will create a folder, but I need the User to have Full Permissions. I have put my code below. (Windows 8 system)
FSO.CreateFolder(lclFolder)
oWS.exec "icacls " & lclFolder & " /reset /inheritance:r /grant:r Users:(OI)(CI)F /T"
I have the script running as Administrator using:
If Not WScript.Arguments.Named.Exists("elevate") Then
CreateObject("Shell.Application").ShellExecute WScript.FullName _
, WScript.ScriptFullName & " /elevate", "", "runas", 1
WScript.Quit
End If
The folder gets created, but the User permissions were: read & execute, List folders contents & Read. After the icacls line was inserted, this did not change. Can anyone advise where I went wrong?
Best Answer
As per Exec Method (Windows Script Host):
Therefore, force embedding folder name in a pair of
"
double quotes as follows:or as follows: