Thursday, June 17, 2010

Create folder with permission and map drive by username

Create folder with permission

 

@echo off

 

for /f %%i in (x:\abc\namefile.txt) do mkdir g:\backup\%%i

g:

cd g:\backup\

FOR /D %%A IN (*) DO cscript x:\abc\xCACLS.vbs g:\backup\%%A /T /E /G domain\%%A:F

 

Remark: For/D %%A IN (*) which is the command running path (e.g. It running in g:\backup\), it will scan all folder in g:\backup\

The backup folder users permission need to set this folder only, otherwise it will  inherited to the \backup\%username%

 

 

map drive by username

 

net use Z: \\abc_server\backup\%username%

Print Friendly and PDF
Share/Bookmark

No comments:

Post a Comment