Batch change “share” permissions on Windows Shares.

24/12/2007 22:54 | Windows | 3428 views | RSS

If you have plenty of shares in 1 direcory, but the permissions on the share level are all set to “everyone read”, and you want everyone to have “full” rights, you have 2 options:

One involves clicking a lot, the other option involves reading on.

You’ll need rmtshare (from the NT4 toolkit, or here). Place the following code in a go.bat file and place it in the directory, and then .. uh .. run it!

DIR /ON /B /L > dirlist.txt
FOR /F "tokens=* delims=" %%i in (dirlist.txt) do
(rmtshare \\127.0.0.1\%%i /grant everyone:full)

Phear the powah of BATCH scripting :)