Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   vbsript (http://www.go4expert.com/forums/vbsript-t9452/)

sweetyarun 19Mar2008 11:35

Hi all
i have to give folder permission through vbscript.
I have a share folder name "test".I have to remove "everyone" group from this folder and add "authenticated users" full control.
i have to run this script on remote computer.( thru terminal services and then run)

strComputer = "."
Dim strHomeFolder, strHome, strUser
Dim intRunError, objShell, objFSO
strHomeFolder = "c:\apps\test"
Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(strHomeFolder) Then
intRunError = objShell.Run("%COMSPEC% /k Echo Y| cacls "& strHomeFolder &" /T /C /G "Authenticated users":F ", 2, True)
  If intRunError <> 0 Then
  Wscript.Echo "Error assigning permissions for user " _
  & strUser & " to home folder " & strHomeFolder
  End If
End If

Please help me i need it very urgently.
Many thanks in advance

All times are GMT +5.5. The time now is 13:01.