Ok, I am trying to write a batch file to set file permissions on all computers on the network. It will be run as an AT job so it needs to be completely automated. I have a command that works from a command prompt, but always dies when I try to run in as part of a batch file.
Here is the command:
Quote:
|
FOR /F " tokens=1 " %i in ('"net view|grep \\') do echo y|cacls $i\c$\* /T /C /G system:F administrators:F "mydomain\domain users":F
|
As I said, from a command prompt this works fine, it will go to all the machines that show up in a net view and set the permissions as I want.
When I put it in a batch or cmd file here is what I get:
Quote:
F was unexpected at this time.
C:\>FOR /F " tokens=1 " F administrators:F "mydomain\domain users":F
|
I know the permssions are far from perfect but I need to get this working before I can set any others.
Any ideas or suggestions?