Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   PLEASE HELP ---> My folder permissions vbs is not working (http://www.go4expert.com/forums/help-folder-permissions-vbs-t12728/)

case2k8 5Aug2008 23:19

PLEASE HELP ---> My folder permissions vbs is not working
 
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


case2k8 6Aug2008 21:49

Re: PLEASE HELP ---> My folder permissions vbs is not working
 
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!!

pradeep 7Aug2008 14:39

Re: PLEASE HELP ---> My folder permissions vbs is not working
 
Why arent you using the cacls command?


All times are GMT +5.5. The time now is 18:09.