Discussion Locked

Automated remote CACLS (NT permissions)

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
How to remotely change folder or file ACL using cacls or registry hack on many NT4 client stations through a batch or script to set everyone group to change instead of read permission. Need command line syntax using either ip address or Netbios computer name using default c$ admin share on remote station.

3 replies

by joseangel

The syntax would be:
cacls \\mycomputer\c$\mydirectory /T /E /G everyone:C
Of course, you must be an administrator of the remote computer "mycomputer"

It is important to note that if you are working with non-english windows, you must non-english names (for spanish, use "todos" instead of "everyone").

If you want to work on many computers at the same time, you can combine this command with a "for" command.
To do so:
-Create a plain text file AllPCs.txt with a list of all the PCs in your network (if you use sequential names, excel would be a good help).
-use the command:
for /F %I IN (AllPCs.txt) DO cacls \\%I%\c$\mydirectory /T /E /G everyone:C
This will read your text file and assign each of the names in it to the variable I,and then execute the command cacls to each of them.

by bcoff56215

I wonder if cacls actually runs across a network to change remote netbios names. I used the /t and /p and everyone:c switches to no avail. Do I need to use the /e switch as well? I am watch the batch file run and it scrolls so fast I assume it does not have time to connect across the network let alone change the ACL.

This discussion is closed to new replies.