Before we discuss your script, I think you should revist the security model you setup on the server. I do not think it is wise to let the user creat home directories. How do you propose to have the user configure security so that another user's home directory can not be accessed by another? I would recommend that you create the home directory and set permissions properly and correctly setup the home directory in the user acount property before the user uses the account. I do not think you want user's to have permissions to create shares at will on your server either.

If your clients include Win9x/NT4 clients, I would recommend creating a hidden share for each user's home directory.
_________________________
Home page: http://www.kixhelp.com/hb/