As much as I try to avoid it, sometimes I need to use Windows servers, and windows .bat
files aren’t exactly the pinnacle of scripting languages. This post is about bulk-sharing home directories with consistent permissions.
I decided to solve this by writing a PHP script to generate a batch file, rather than use VB script.
This crude script will make a batch file to share every subdirectory (in this case, hundreds of users’ home directories), and also delete desktop.ini
from each of them. Save the code below as magic.php
, run it, and then run tricks.bat
.
|
|
As a side note, /GRANT:EVERYONE,FULL
is safe in this environment because ACLs are used for access control,
I’ve heard that Windows PowerShell is useful once you get used to it, but it’s not a useful skill outside of Windows admin, so for now a couple of PHP scripts will have to do.