I need to execute windows cmd command in my php script in a loop
In terminal, I execute
icacls \\ FS \ folder \ file.txt / inheritance: e
The command enables inheritance on the specified file.
How do I execute this command correctly?
system ('icacls \\ FS \ folder \ file.txt / inheritance: e')
exec ('icacls \\ FS \ folder \ file.txt / inheritance: e');
But I don’t get any errors or results, tell me how to do it right?
Answer 1, authority 100%
After a day of proceedings, I found a solution:
In environment variables, I overwritten the PATH variable to% USERPROFILE% \ AppData \ Local \ Temp, restarted Apache and it worked.
There is a second parameter where you need to pass the variable by reference. the result of the execution will be there.