I've used successfully subprocess.check_output to call plenty of windows programs.
Yet, I'm troubled at calling icacls.
By cmd, this works:
cmd>icacls "C:\my folder" /GRANT *S-1-1-0:F
I've tried:
subprocess.check_output(['C:\\Windows\\System32\\icacls.exe','"C:\\my folder"','/GRANT *S-1-1-0:F'],shell=True,stderr=subprocess.STDOUT)
but return code is 123 (according to micrsoft, invalid file name).
I've also tried (which also works from cmd)
subprocess.check_output(['C:\\Windows\\System32\\icacls.exe','"C:/my folder"','/GRANT *S-1-1-0:F'],shell=True,stderr=subprocess.STDOUT)
but return code is also 123.
Any idea?