Code:


$h="$server\$dept\home\@userid"
if not exist($h)
md $h
if not @error
$=sendmessage($dcsa,"Home Folder created at $h for @userid")
shell "%comspec% /c echo y| cacls $h /t /c /g @ldomain\@userid:c"
shell '%comspec% /c echo y| cacls $h /t /e /c /g "@ldomain\domain admins:f"'
shell "%comspec% /c echo y| cacls $h /t /e /c /g @ldomain\$group"+"mis:c"
else
$=sendmessage($dcsa,"Home Folder was NOT created at $h for @userid")
endif
endif

_________________________
How to ask questions the smart way <-----------> Before you ask