That script should work fine...
However try this one, using WinNT.
Code:

Function CreateShare($folder,$sharename)
Dim $objServerService, $objFileShare
$objServerService = GetObject("WinNT://" + @WKSTA + "/lanmanServer")
$objFileShare = $objServerService.Create("fileshare", $sharename)
$objFileShare.Path = $folder
$objFileShare.MaxUserCount = -1
$objFileShare.SetInfo
? @ERROR
EndFunction



Edited by apronk (2006-10-03 01:01 PM)