set xfold=F:\Labs\Firstyearlab
set xname=%1
net user %xname% new@123 /add
md %xfold%\%xname%
rmtshare \\servername\%xname%$=%xfold%\%xname% /USERS:1 /GRANT Administrator:F /GRANT %xname%:C
echo Y |cacls %xfold%\%xname% /E /R Everyone /P Administrator:F %xname%:C
save this file as .bat and put in c drive. open dos prompt run
eg. c:> user.bat newusername
then create user successfully
No comments:
Post a Comment