1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

vbsript

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

  1. sweetyarun

    sweetyarun New Member

    Joined:
    Mar 14, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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