I am sure Rad's code is better but here is the code I use:
Code:

$ShareName = "TUser"
$ServerName = "FileSVR"
$SharePath = "\\" + $ServerName + "\Users\" + $ShareName
$Discription = "User Share for their My Documents."

CreateShareFolder($ServerName,$ShareName,$SharePath,$Discription)

Function CreateShareFolder($ServerName,$ShareName,$SharePath,$Discription)

$FILE_SHARE = 0
$MAXIMUM_CONNECTIONS = -1 ; -1 allows unlimited connections.
$objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + $ServerName + "\root\cimv2")
$objNewShare = $objWMIService.Get("Win32_Share")
$FileShare = $objNewShare.Create($SharePath,$ShareName,$FILE_SHARE,$MAXIMUM_CONNECTIONS,$Discription)

EndFunction



Edited by benny69 (2006-10-02 05:08 PM)
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)