I am making a simple script for a network where ever a homefolder is created for every user. Making the users + putting them in the correct group works perfectly but as soon as I add the homefolder part it only executes once. This script is called 9 times in another script but it only works once.
rem ****** %1 username
rem ****** %2 password
rem ****** %3 group
net user %1 %2 /ADD
net user %1 /logonpasswordchg:no
net user %1 /active:yes
net user %1 /expires:NEVER
net user %1 /times:M-F,8-18
net user %1 /passwordchg:no
net group %3 %1 /add
C:
cd \School\Homefolders\Leerlingen
md %1
echo Y| cacls C:\School\Homefolders\Leerlingen\%1 /G %1:C administrators:F
cd..
cd..
cd..
cd..
C:
cdline it could be it's not actually changing to the right drive. The line that saysC:won't actually do anything, try usingcd /d C:instead and see if that works.