PLEASE HELP ---> My folder permissions vbs is not working

Discussion in 'Web Design, HTML And CSS' started by case2k8, Aug 5, 2008.

  1. case2k8

    case2k8 New Member

    Joined:
    Aug 5, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Here is the script that needs an expert to look at:

    Note: The only thing working on this script is a successful installation of TOAD. The permissions section and the copy file section is not working. Can you help?

    Code:
    On Error Resume NExt
    Dim objShell, objNewPort, objWMIService, oFSO, Path, strComputerA 
    Dim RunErrorToReturn, Results 
    Dim strComputer : strComputer = "." 
    Dim objNetwork : Set objNetwork = CreateObject("WScript.Network") 
    strComputerA = objNetwork.ComputerName
    
    Set objWMIService = GetObject("winmgmts:"& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 
    Set objShell = CreateObject("WScript.Shell")
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    ProgramFiles = objShell.ExpandEnvironmentStrings("%ProgramFiles%")
    windir= objShell.ExpandEnvironmentStrings("%windir%")
    temp = objShell.ExpandEnvironmentStrings("%temp%")
    allusers=objShell.ExpandEnvironmentStrings("%AllUsersProfile%")
    
    path= oFSO.GetParentFolderName(WScript.ScriptFullName)
    
    objShell.Run path+"\Toad_Standalone\9_6_1_1\ToadforOracle961SetupFull.msi /qb ALLUSERS=1 ADDLOCAL=Server,Client",1,TRUE
    
    objShell.Run """" & path & "\Setacl.exe"" -on """ & ProgramFiles & "\Quests~1"" -ot file -actn ace -ace ""n:S-1-5-11;p:full;s:y"" -actn clear -clr ""dacl,sacl"" -actn rstchldrn -rst ""dacl,sacl"" -silent",1,TRUE 
    
    Set fso=CreateObject("Scripting.FileSystemObject")
    fso.CopyFile "\\server\esl$\Oracle\Toad\9.6.1\Client\QSAuth11.key", "C:\Program Files\Quest Software\Toad for Oracle\", 0, TRUE
    
    
    'If there was an error return it otherwise return 0 with a success; 
    If Err.Number<>0 Then 
    RunErrorToReturn = Err.Number 
    Results = src1(1) & vbstatus & ", exiting." 
    SMSWriteStatusMIF "if then", "TOAD961", "1", Results, src2(1) 
    wscript.quit(RunErrorToReturn) 
    Else 
    RunErrorToReturn = 0
     
    Last edited by a moderator: Aug 6, 2008
  2. case2k8

    case2k8 New Member

    Joined:
    Aug 5, 2008
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    I got it to work with Setacl.exe. This exe has to be in the same directory as the vbs.

    Also, I needed to put an "o" in front of the fso for the copy command to work.

    Thanks!!
     
  3. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    Why arent you using the cacls command?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice