Could anyone explain this behaviour to me?
I needed to change the permissions of a folder on a number of machines to enable write access by pupils and staff.
If I run the command:
psexec @"c:\computers.txt" cacls "c:\Program Files\Application" /E /T /C
It loops through all the computers and returns "with error code 2" for each machine, cannot find the file specified.
But if I run the following command:
for /F %A in (c:\computers.txt) do psexec \\%A cacls "c:\Program Files\Application" /E /T /C /G Users:F
It completes the task without issue.
The computers.txt file is the same in both instances. It just seems strange that I have to circumvent the built-in functionality.
This is more of a head-scratcher than anything so I was wondering if anyone could explain to me the reason for this.