i2i8 Posted February 1, 2014 Posted February 1, 2014 (edited) No problem running CMD: SetACL -on drivers -ot file -actn ace -ace "n:Everyone;p:read_ex" However, this does not work: Local $FilesPath = @ScriptDir & '\drivers',$SetACL_Read_ex = '-ot file -actn ace -ace "n:Everyone;p:read_ex"' Run(@ComSpec & " /c " & "SetACL -on" & $FilesPath & $SetACL_Read_ex ,"",@SW_HIDE) Why? Edited February 1, 2014 by i2i8
michaelslamet Posted February 1, 2014 Posted February 1, 2014 Seems you forgot to put a space between $FilesPath & $SetACL_Read_ex so try $FilesPath & " " & $SetACL_Read_ex
COD3369 Posted February 1, 2014 Posted February 1, 2014 Run(@ComSpec & " /c " & "SetACL -on " &" "& $FilesPath &" "& $SetACL_Read_ex ,"",@SW_HIDE) Try this !
i2i8 Posted February 1, 2014 Author Posted February 1, 2014 (edited) Seems you forgot to put a space between $FilesPath & $SetACL_Read_ex so try $FilesPath & " " & $SetACL_Read_ex I've tried this: Local $FilesPath = @ScriptDir & '\drivers',$SetACL_Read_ex = '-ot file -actn ace -ace "n:Everyone;p:read_ex"' Run(@ComSpec & " /c " & "SetACL -on" & "" & $FilesPath & "" & $SetACL_Read_ex,"",@SW_HIDE) or: Local $FilesPath = @ScriptDir & '\drivers',$SetACL_Read_ex = '-ot file -actn ace -ace "n:Everyone;p:read_ex"' Run(@ComSpec & " /c " & "SetACL -on" & $FilesPath & "" & $SetACL_Read_ex,"",@SW_HIDE) But,it still not working Edited February 1, 2014 by i2i8
Factfinder Posted February 1, 2014 Posted February 1, 2014 Use "SetACL -on " instead of "SetACL -on" to have a space between -on and $FilesPath. Also use $SetACL_Read_ex = ' -ot instead of $SetACL_Read_ex = '-ot or use $FilesPath & " " & $SetACL_Read_ex So it will be one of these: Local $FilesPath = @ScriptDir & '\drivers',$SetACL_Read_ex = ' -ot file -actn ace -ace "n:Everyone;p:read_ex"' Run(@ComSpec & " /c " & "SetACL -on " & $FilesPath & $SetACL_Read_ex ,"",@SW_HIDE) Local $FilesPath = @ScriptDir & '\drivers',$SetACL_Read_ex = '-ot file -actn ace -ace "n:Everyone;p:read_ex"' Run(@ComSpec & " /c " & "SetACL -on " & $FilesPath & " " & $SetACL_Read_ex ,"",@SW_HIDE)
i2i8 Posted February 1, 2014 Author Posted February 1, 2014 Use "SetACL -on " instead of "SetACL -on" to have a space between -on and $FilesPath. Also use $SetACL_Read_ex = ' -ot instead of $SetACL_Read_ex = '-ot or use $FilesPath & " " & $SetACL_Read_ex So it will be one of these: Local $FilesPath = @ScriptDir & '\drivers',$SetACL_Read_ex = ' -ot file -actn ace -ace "n:Everyone;p:read_ex"' Run(@ComSpec & " /c " & "SetACL -on " & $FilesPath & $SetACL_Read_ex ,"",@SW_HIDE) Local $FilesPath = @ScriptDir & '\drivers',$SetACL_Read_ex = '-ot file -actn ace -ace "n:Everyone;p:read_ex"' Run(@ComSpec & " /c " & "SetACL -on " & $FilesPath & " " & $SetACL_Read_ex ,"",@SW_HIDE) It still not working
i2i8 Posted February 1, 2014 Author Posted February 1, 2014 (edited) I'm so happy, I finally understand the correct usage of the script code Thank you for helping my friends, thank you! Local $FilesPath = @ScriptDir & "\drivers",$SetACL_Read_ex = '-ot file -actn ace -ace "n:Everyone;p:read_ex"' Run(@ComSpec & " /c " & 'SetACL -on' & " " & $FilesPath & " " & $SetACL_Read_ex,"",@SW_HIDE) Edited February 1, 2014 by i2i8
Factfinder Posted February 1, 2014 Posted February 1, 2014 Run(@ComSpec & " /c " & "SetACL -on " &" "& $FilesPath &" "& $SetACL_Read_ex ,"",@SW_HIDE) Try this ! It was already given.
i2i8 Posted February 1, 2014 Author Posted February 1, 2014 It was already given. After "SetACL -on",no one space You add this code more than one space
Factfinder Posted February 1, 2014 Posted February 1, 2014 Use "SetACL -on " instead of "SetACL -on" to have a space between -on and $FilesPath. Also use $SetACL_Read_ex = ' -ot instead of $SetACL_Read_ex = '-ot or use $FilesPath & " " & $SetACL_Read_ex So it will be one of these: Local $FilesPath = @ScriptDir & '\drivers',$SetACL_Read_ex = ' -ot file -actn ace -ace "n:Everyone;p:read_ex"' Run(@ComSpec & " /c " & "SetACL -on " & $FilesPath & $SetACL_Read_ex ,"",@SW_HIDE) Local $FilesPath = @ScriptDir & '\drivers',$SetACL_Read_ex = '-ot file -actn ace -ace "n:Everyone;p:read_ex"' Run(@ComSpec & " /c " & "SetACL -on " & $FilesPath & " " & $SetACL_Read_ex ,"",@SW_HIDE) In both the above cases there was only one space.
i2i8 Posted February 1, 2014 Author Posted February 1, 2014 In both the above cases there was only one space. Thank you for your continued interest in my topic and for helping me but I suggest you test this yourself better SetACL
i2i8 Posted February 2, 2014 Author Posted February 2, 2014 I'm so happy, I finally understand the correct usage of the script code Thank you for helping my friends, thank you! Local $FilesPath = @ScriptDir & "\drivers",$SetACL_Read_ex = '-ot file -actn ace -ace "n:Everyone;p:read_ex"' Run(@ComSpec & " /c " & 'SetACL -on' & " " & $FilesPath & " " & $SetACL_Read_ex,"",@SW_HIDE) Just now, when I run this code again, it does not work.why??
michaelslamet Posted February 2, 2014 Posted February 2, 2014 Try to replace the Run(@ComSpec & " /c " with Run(@ComSpec & " /k " so you can see what's wrong
i2i8 Posted February 2, 2014 Author Posted February 2, 2014 Try to replace the Run(@ComSpec & " /c " with Run(@ComSpec & " /k " so you can see what's wrong I could not see the wrong.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now