1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

vbsript

Discussion in 'Web Design, HTML And CSS Forums' started by sweetyarun, Mar 19, 2008.

  1. sweetyarun

    sweetyarun New Member

    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)
    Code:
    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
    WScript.Quit
    Please help me i need it very urgently.
    Many thanks in advance
     
    Last edited by a moderator: Mar 20, 2008

Share This Page