To Create folder and grant permission to user to access this folder and his/her own folder:
Prepare the username into a file call namefile.txt in X:\backup\namefile.txt
Batch to create folder name from a name list (Must be same at Windows login name):
@echo off
for /f %%i in (X:\backup\namefile.txt) do mkdir %%i
(Remark: if running in console/command prompt it should be “for /F %i in (X:\backup\namefile.txt) do mkdir %i”)
To grant permission to the individual folder:
@echo off
FOR /D %%A IN (*) DO cscript xCACLS.vbs X:\backup\%%A /T /E /G MyDomain\%%A:F
No comments:
Post a Comment