Jump to content

Recommended Posts

Posted (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 by i2i8
Posted (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 by i2i8
Posted

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)
Posted

 

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 :sweating: 

Posted (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 by i2i8
Posted

 

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.

Posted

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

Posted

 

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??

Posted

Try to replace the Run(@ComSpec & " /c " with Run(@ComSpec & " /k " so you can see what's wrong

I could not see the wrong.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...