Hi ,
I use the below code to assign rights to the folder this works fine when i create a folder on say "C:/Test" and run the code it works fine without any issues but once i try the same with the folder "C:/Documents and Settings" i get an error .
Here is the code its a VBA code done on a word document.
Dim intRunError, objShell, objFSO,strHomeFolder
strHomeFolder = "C:/Documents and Settings"Set objShell = CreateObject("Wscript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists(strHomeFolder) Then intRunError = objShell.Run("%COMSPEC% /c Echo Y| cacls " _ & strHomeFolder & " /e /c /g everyone:F ", 2, True) End If MsgBox intRunError