Jens grabs into his magic hat, and... pulls out a rabbit script:
code:
  $username='whatever'
$userdir='d:\users\'+$username
$rmtsharebin='rmtshare.exe'
$caclsbin='cacls.exe'

if not exist($userdir)
? 'Creating user directory for user '+$username
md $userdir
endif

? 'Setting permissions on personal directory for user '+$username

$shellcommand='echo y| '+$caclsbin+' "'+$userdir+'" /T /C /G Administrators:f "'+$username+'":c'
shell '%COMSPEC% /e:1024 /C '+$shellcommand

? 'Creating hidden network share for personal directory'
$shellcommand=$rmtsharebin+' \\SERVER\"'+$username+'$$"="e:\users\'+$username+'" /unlimited'
$shellcommand=$shellcommand+' /remark:"private home directory"'
$shellcommand=$shellcommand+' /grant "'+$username+'":c'
shell '%COMSPEC% /e:1024 /C '+$shellcommand

_________________________
There are two types of vessels, submarines and targets.