kennysarmy Posted July 2, 2008 Posted July 2, 2008 I have a sequence of batch files / commands I run at the start of each year to set up the new intake. These are: ONE. On server at command prompt type addusers /c d:\addusers\2008\newuser.csv where newuser.csv has the following entries: [user] Usernam Surname Forename School Pupil TWO. Run pupils.bat which has the following entries: @call mkdir.bat 3357 33 3300 57 @call mkdir.bat 4453 44 4400 53 where mkdir.bat has the following entries: mkdir D:\Users\%3\%4 net share %1$ /d net share %1$=D:\Users\%3\%4 /users:5 echo y|cacls D:\Users\%3\%4 /t /c /g %1:c "CREATOR OWNER":f "Domain Admins":f Staff:c Administrators:f net user %1 /HOMEDIR:\\FP2\%1$ net user %1 /SCRIPTPATH:pupils.bat THREE In AD add newly created pupils to pupils group highlight all new pupils, right click and choose Add members to group Now, what I want to do is also create sub-folders in each user area created say for "ICT", "Maths", "DT" etc. Any suggestions welcome Thanks.
srochford Posted July 2, 2008 Posted July 2, 2008 Just change mkdir D:\Users\%3\%4 to mkdir D:\Users\%3\%4 mkdir D:\Users\%3\%4\maths mkdir D:\Users\%3\%4\ict mkdir D:\Users\%3\%4\design or (bit more flash :-)) mkdir D:\Users\%3\%4 for %%i in (ict maths dt) do mkdir D:\Users\%3\%4\%%i 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now